⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 useraction.cs

📁 Asp.net物资流通管理系统源码 本系统主要针对物流供应链中的库存管理环节
💻 CS
字号:
using System;
using System.Data;
using System.Data.SqlClient;
using System.Configuration;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;

/// <summary>
/// UserAction 的摘要说明
/// </summary>
public class UserAction:SqlDataBase
{
	public UserAction()
	{
		//
		// TODO: 在此处添加构造函数逻辑
		//
	}
    public bool UserChangePwd(string UserNam,string OldPwd,string NewPwd) 
    {
        SqlDataBase MyDB = new SqlDataBase();
        int CheckNum = Convert.ToInt32(MyDB.ReturnSQL("select count(*) from UserList where UserName = '" + UserNam + "'and PassWord = '" + OldPwd + "'"));
        if (CheckNum > 0)
        {
            MyDB.NoreturnSql("update UserList set PassWord='" + NewPwd + "' where UserName = '" + UserNam + "'");
            return true;
        }
        else 
        {
            return false;
        }
    }
    public bool UserAdd(string UserNam,string Pwd,string AlignK,string Types) 
    {
        SqlDataBase MyDB = new SqlDataBase();
        int CheckNum = Convert.ToInt32(MyDB.ReturnSQL("select count(*) from UserList where UserName = '" + UserNam + "'"));
        if (CheckNum > 0)
        {
            return false;
        }
        else
        {
            MyDB.NoreturnSql("insert into UserList(UserName,PassWord,Controls,GoodsType) values('" + UserNam + "','" + Pwd + "','" + AlignK + "','" + Types + "')");
            return true;
        }
    }
    public DataTable GiveSysC()//返回通知列表
    {
        SqlDataBase MyDb = new SqlDataBase();
        return MyDb.DT("select * from SystemTest where TestType = 0 order By ID desc");
    }
    public DataTable GiveSysX(string ID) 
    {
        SqlDataBase MyDb = new SqlDataBase();
        return MyDb.DT("select * from SystemTest where ID = '" + ID + "'");
    }
    public static DataTable GetBigClass() //返回产品大类
    {
        SqlDataBase MyDb = new SqlDataBase();
        return MyDb.DT("select * from BigClass");
    }
    public static DataTable GetSmaGoods(string ID)//返回大类所属的产品列表
    {
        SqlDataBase MyDb = new SqlDataBase();
        return MyDb.DT("select ID,GoodsNum,GoodsName from AllGood where AlignType = '"+ID+"'");
    }

    #region //产品入库
    public int InsertGoods(int AlignGoods, string GoodCost, int GoodNum, string GoodMake, string GoodsBZ, string InputTime)
    {
        SqlParameter[] prams = {
            IntParam("@AlignGoods", SqlDbType.Int, 4, AlignGoods),
            IntParam("@GoodCost", SqlDbType.VarChar, 50, GoodCost),
            IntParam("@GoodNum", SqlDbType.Int, 4, GoodNum),
            IntParam("@GoodMake", SqlDbType.VarChar, 50, GoodMake),
            IntParam("@GoodsBZ", SqlDbType.VarChar, 50, GoodsBZ),
            IntParam("@InputTime", SqlDbType.VarChar, 50, InputTime),
            OutParam("@GoodsID",SqlDbType.Int,4)
        };
        RunInsert("InsertGood", prams);
        return Convert.ToInt32(prams[6].Value);
        //return Convert.ToInt32(prams[0].Value);
    }
    #endregion

    public static void UpdateBigGodNum(int Num,int GodID) //入库产品大类数量更新
    {
        SqlDataBase MyDb = new SqlDataBase();
        MyDb.NoreturnSql("update AllGood set NowNum = NowNum + " + Num + " Where ID = '" + GodID + "'");
        //return "update AllGood set NowNum = NowNum + '" + Num + "' Where ID = '" + GodID + "'";
    }
    public static void OutPut(int Num, int GodID) //出库产品大类数量更新
    {
        SqlDataBase MyDb = new SqlDataBase();
        MyDb.NoreturnSql("update AllGood set NowNum = NowNum - " + Num + " Where ID = '" + GodID + "'");
    }
    public static void InsertGodPaper(int GodsID ,int GodsNum,string GetUser,string InputUser,string InputTime,string PaperType) 
    {//单据表
        SqlDataBase MyDb = new SqlDataBase();
        MyDb.NoreturnSql("Insert Into GoodPapers(GoodsID,GoodsNum,GetUser,InputUser,GetTime,PaperType)Values('" + GodsID + "','" + GodsNum + "','" + GetUser + "','" + InputUser + "','" + InputTime + "','" + PaperType + "')");
    }
    public static void InsertRecordList(string InputUser, int GodsID, int GodsNum, string PaperType, string InputTime) 
    {//操作日志表
        SqlDataBase MyDb = new SqlDataBase();
        MyDb.NoreturnSql("Insert Into RecordList(UserName,GoodID,GoodNum,TypesID,RecordTime)Values('" + InputUser + "','" + GodsID + "','" + GodsNum + "','" + PaperType + "','" + InputTime + "')");
    }
    public static int GetBigGID(int GoodsID)//返回仓库产品所对应的大类产品ID
    {
        SqlDataBase MyDb = new SqlDataBase();
        return Convert.ToInt32(MyDb.ReturnSQL("select AlignGoods from GoodList where ID = '" + GoodsID + "'"));
    }
}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -