コード例 #1
0
        public string GetEmpWorkingList(int EmpID, DateTime dt1, DateTime dt2)
        {
            Hownet.BLL.WorkTicketInfo bllWTI = new Hownet.BLL.WorkTicketInfo();
            string EmpAmount = bllWTI.GetEmpSum(EmpID, dt1, dt2, false);

            Hownet.BLL.MiniEmp   bllME = new Hownet.BLL.MiniEmp();
            Hownet.Model.MiniEmp modME = bllME.GetModel(EmpID);
            DataTable            dt    = bllME.GetSumAmountByID(Convert.ToInt32(modME.IDCardID), dt1, dt2).Tables[0];


            return(EmpAmount + "ю" + Table2String(dt));
        }
コード例 #2
0
ファイル: MiniEmp.cs プロジェクト: miradel51/HownetServer
        /// <summary>
        /// 增加一条数据
        /// </summary>
        public int Add(Hownet.Model.MiniEmp model)
        {
            StringBuilder strSql = new StringBuilder();

            strSql.Append("insert into MiniEmp(");
            strSql.Append("Name,IntroducerID,IdentityCard,Sex,Sn,Province,Address,Phone,AccDate,WorkTypeID,PayID,DimDate,BedID,TableID,DepartmentID,DegreeID,PolityID,SOSPhone,SOSMan,NowAddress,FillDate,FillUser,LassMoney,Royalty,Image,IsUse,City,County,Remark,IDCardID,IsEnd,Deposit,NeedDeposit,DefaultWorkType,BoardWages,HeTongDate,HeTongAmount,HeTongDQDate,IsCaicTiCheng,MaxAmountDay,BankNO,BankAccountName,BankName)");
            strSql.Append(" values (");
            strSql.Append("@Name,@IntroducerID,@IdentityCard,@Sex,@Sn,@Province,@Address,@Phone,@AccDate,@WorkTypeID,@PayID,@DimDate,@BedID,@TableID,@DepartmentID,@DegreeID,@PolityID,@SOSPhone,@SOSMan,@NowAddress,@FillDate,@FillUser,@LassMoney,@Royalty,@Image,@IsUse,@City,@County,@Remark,@IDCardID,@IsEnd,@Deposit,@NeedDeposit,@DefaultWorkType,@BoardWages,@HeTongDate,@HeTongAmount,@HeTongDQDate,@IsCaicTiCheng,@MaxAmountDay,@BankNO,@BankAccountName,@BankName)");
            strSql.Append(";select @@IDENTITY");
            SqlParameter[] parameters =
            {
                new SqlParameter("@Name",            SqlDbType.NVarChar,    12),
                new SqlParameter("@IntroducerID",    SqlDbType.Int,          4),
                new SqlParameter("@IdentityCard",    SqlDbType.NVarChar,    18),
                new SqlParameter("@Sex",             SqlDbType.TinyInt,      1),
                new SqlParameter("@Sn",              SqlDbType.NVarChar,    11),
                new SqlParameter("@Province",        SqlDbType.Int,          4),
                new SqlParameter("@Address",         SqlDbType.NVarChar,   255),
                new SqlParameter("@Phone",           SqlDbType.NVarChar,    18),
                new SqlParameter("@AccDate",         SqlDbType.DateTime),
                new SqlParameter("@WorkTypeID",      SqlDbType.NVarChar,   200),
                new SqlParameter("@PayID",           SqlDbType.Int,          4),
                new SqlParameter("@DimDate",         SqlDbType.DateTime),
                new SqlParameter("@BedID",           SqlDbType.Int,          4),
                new SqlParameter("@TableID",         SqlDbType.Int,          4),
                new SqlParameter("@DepartmentID",    SqlDbType.Int,          4),
                new SqlParameter("@DegreeID",        SqlDbType.Int,          4),
                new SqlParameter("@PolityID",        SqlDbType.Int,          4),
                new SqlParameter("@SOSPhone",        SqlDbType.NVarChar,    18),
                new SqlParameter("@SOSMan",          SqlDbType.NVarChar,    12),
                new SqlParameter("@NowAddress",      SqlDbType.NVarChar,    50),
                new SqlParameter("@FillDate",        SqlDbType.DateTime),
                new SqlParameter("@FillUser",        SqlDbType.Int,          4),
                new SqlParameter("@LassMoney",       SqlDbType.Decimal,      9),
                new SqlParameter("@Royalty",         SqlDbType.Decimal,      9),
                new SqlParameter("@Image",           SqlDbType.NVarChar,    50),
                new SqlParameter("@IsUse",           SqlDbType.Bit,          1),
                new SqlParameter("@City",            SqlDbType.Int,          4),
                new SqlParameter("@County",          SqlDbType.Int,          4),
                new SqlParameter("@Remark",          SqlDbType.NVarChar,  2000),
                new SqlParameter("@IDCardID",        SqlDbType.BigInt,       8),
                new SqlParameter("@IsEnd",           SqlDbType.Int,          4),
                new SqlParameter("@Deposit",         SqlDbType.Decimal,      9),
                new SqlParameter("@NeedDeposit",     SqlDbType.Decimal,      9),
                new SqlParameter("@DefaultWorkType", SqlDbType.NVarChar,   500),
                new SqlParameter("@BoardWages",      SqlDbType.Decimal,      9),
                new SqlParameter("@HeTongDate",      SqlDbType.DateTime),
                new SqlParameter("@HeTongAmount",    SqlDbType.NVarChar,    50),
                new SqlParameter("@HeTongDQDate",    SqlDbType.DateTime),
                new SqlParameter("@IsCaicTiCheng",   SqlDbType.Bit,          1),
                new SqlParameter("@MaxAmountDay",    SqlDbType.Int,          4),
                new SqlParameter("@BankNO",          SqlDbType.NVarChar,    50),
                new SqlParameter("@BankAccountName", SqlDbType.NVarChar,    50),
                new SqlParameter("@BankName",        SqlDbType.NVarChar, 50)
            };
            parameters[0].Value  = model.Name;
            parameters[1].Value  = model.IntroducerID;
            parameters[2].Value  = model.IdentityCard;
            parameters[3].Value  = model.Sex;
            parameters[4].Value  = model.Sn;
            parameters[5].Value  = model.Province;
            parameters[6].Value  = model.Address;
            parameters[7].Value  = model.Phone;
            parameters[8].Value  = model.AccDate;
            parameters[9].Value  = model.WorkTypeID;
            parameters[10].Value = model.PayID;
            parameters[11].Value = model.DimDate;
            parameters[12].Value = model.BedID;
            parameters[13].Value = model.TableID;
            parameters[14].Value = model.DepartmentID;
            parameters[15].Value = model.DegreeID;
            parameters[16].Value = model.PolityID;
            parameters[17].Value = model.SOSPhone;
            parameters[18].Value = model.SOSMan;
            parameters[19].Value = model.NowAddress;
            parameters[20].Value = model.FillDate;
            parameters[21].Value = model.FillUser;
            parameters[22].Value = model.LassMoney;
            parameters[23].Value = model.Royalty;
            parameters[24].Value = model.Image;
            parameters[25].Value = model.IsUse;
            parameters[26].Value = model.City;
            parameters[27].Value = model.County;
            parameters[28].Value = model.Remark;
            parameters[29].Value = model.IDCardID;
            parameters[30].Value = model.IsEnd;
            parameters[31].Value = model.Deposit;
            parameters[32].Value = model.NeedDeposit;
            parameters[33].Value = model.DefaultWorkType;
            parameters[34].Value = model.BoardWages;
            parameters[35].Value = model.HeTongDate;
            parameters[36].Value = model.HeTongAmount;
            parameters[37].Value = model.HeTongDQDate;
            parameters[38].Value = model.IsCaicTiCheng;
            parameters[39].Value = model.MaxAmountDay;
            parameters[40].Value = model.BankNO;
            parameters[41].Value = model.BankAccountName;
            parameters[42].Value = model.BankName;

            object obj = DbHelperSQL.GetSingle(strSql.ToString(), parameters);

            if (obj == null)
            {
                return(0);
            }
            else
            {
                return(Convert.ToInt32(obj));
            }
        }
コード例 #3
0
ファイル: MiniEmp.cs プロジェクト: miradel51/HownetServer
        /// <summary>
        /// 得到一个对象实体
        /// </summary>
        public Hownet.Model.MiniEmp GetModel(int ID)
        {
            StringBuilder strSql = new StringBuilder();

            strSql.Append("select  top 1 ID,Name,IntroducerID,IdentityCard,Sex,Sn,Province,Address,Phone,AccDate,WorkTypeID,PayID,DimDate,BedID,TableID,DepartmentID,DegreeID,PolityID,SOSPhone,SOSMan,NowAddress,FillDate,FillUser,LassMoney,Royalty,Image,IsUse,City,County,Remark,IDCardID,IsEnd,Deposit,NeedDeposit,DefaultWorkType,BoardWages,HeTongDate,HeTongAmount,HeTongDQDate,IsCaicTiCheng,MaxAmountDay,BankNO,BankAccountName,BankName from MiniEmp ");
            strSql.Append(" where ID=@ID");
            SqlParameter[] parameters =
            {
                new SqlParameter("@ID", SqlDbType.Int, 4)
            };
            parameters[0].Value = ID;

            Hownet.Model.MiniEmp model = new Hownet.Model.MiniEmp();
            DataSet ds = DbHelperSQL.Query(strSql.ToString(), parameters);

            if (ds.Tables[0].Rows.Count > 0)
            {
                if (ds.Tables[0].Rows[0]["ID"] != null && ds.Tables[0].Rows[0]["ID"].ToString() != "")
                {
                    model.ID = int.Parse(ds.Tables[0].Rows[0]["ID"].ToString());
                }
                model.Name = ds.Tables[0].Rows[0]["Name"].ToString();
                if (ds.Tables[0].Rows[0]["IntroducerID"] != null && ds.Tables[0].Rows[0]["IntroducerID"].ToString() != "")
                {
                    model.IntroducerID = int.Parse(ds.Tables[0].Rows[0]["IntroducerID"].ToString());
                }
                model.IdentityCard = ds.Tables[0].Rows[0]["IdentityCard"].ToString();
                if (ds.Tables[0].Rows[0]["Sex"] != null && ds.Tables[0].Rows[0]["Sex"].ToString() != "")
                {
                    model.Sex = int.Parse(ds.Tables[0].Rows[0]["Sex"].ToString());
                }
                model.Sn = ds.Tables[0].Rows[0]["Sn"].ToString();
                if (ds.Tables[0].Rows[0]["Province"] != null && ds.Tables[0].Rows[0]["Province"].ToString() != "")
                {
                    model.Province = int.Parse(ds.Tables[0].Rows[0]["Province"].ToString());
                }
                model.Address = ds.Tables[0].Rows[0]["Address"].ToString();
                model.Phone   = ds.Tables[0].Rows[0]["Phone"].ToString();
                if (ds.Tables[0].Rows[0]["AccDate"] != null && ds.Tables[0].Rows[0]["AccDate"].ToString() != "")
                {
                    model.AccDate = DateTime.Parse(ds.Tables[0].Rows[0]["AccDate"].ToString());
                }
                model.WorkTypeID = ds.Tables[0].Rows[0]["WorkTypeID"].ToString();
                if (ds.Tables[0].Rows[0]["PayID"] != null && ds.Tables[0].Rows[0]["PayID"].ToString() != "")
                {
                    model.PayID = int.Parse(ds.Tables[0].Rows[0]["PayID"].ToString());
                }
                if (ds.Tables[0].Rows[0]["DimDate"] != null && ds.Tables[0].Rows[0]["DimDate"].ToString() != "")
                {
                    model.DimDate = DateTime.Parse(ds.Tables[0].Rows[0]["DimDate"].ToString());
                }
                if (ds.Tables[0].Rows[0]["BedID"] != null && ds.Tables[0].Rows[0]["BedID"].ToString() != "")
                {
                    model.BedID = int.Parse(ds.Tables[0].Rows[0]["BedID"].ToString());
                }
                if (ds.Tables[0].Rows[0]["TableID"] != null && ds.Tables[0].Rows[0]["TableID"].ToString() != "")
                {
                    model.TableID = int.Parse(ds.Tables[0].Rows[0]["TableID"].ToString());
                }
                if (ds.Tables[0].Rows[0]["DepartmentID"] != null && ds.Tables[0].Rows[0]["DepartmentID"].ToString() != "")
                {
                    model.DepartmentID = int.Parse(ds.Tables[0].Rows[0]["DepartmentID"].ToString());
                }
                if (ds.Tables[0].Rows[0]["DegreeID"] != null && ds.Tables[0].Rows[0]["DegreeID"].ToString() != "")
                {
                    model.DegreeID = int.Parse(ds.Tables[0].Rows[0]["DegreeID"].ToString());
                }
                if (ds.Tables[0].Rows[0]["PolityID"] != null && ds.Tables[0].Rows[0]["PolityID"].ToString() != "")
                {
                    model.PolityID = int.Parse(ds.Tables[0].Rows[0]["PolityID"].ToString());
                }
                model.SOSPhone   = ds.Tables[0].Rows[0]["SOSPhone"].ToString();
                model.SOSMan     = ds.Tables[0].Rows[0]["SOSMan"].ToString();
                model.NowAddress = ds.Tables[0].Rows[0]["NowAddress"].ToString();
                if (ds.Tables[0].Rows[0]["FillDate"] != null && ds.Tables[0].Rows[0]["FillDate"].ToString() != "")
                {
                    model.FillDate = DateTime.Parse(ds.Tables[0].Rows[0]["FillDate"].ToString());
                }
                if (ds.Tables[0].Rows[0]["FillUser"] != null && ds.Tables[0].Rows[0]["FillUser"].ToString() != "")
                {
                    model.FillUser = int.Parse(ds.Tables[0].Rows[0]["FillUser"].ToString());
                }
                if (ds.Tables[0].Rows[0]["LassMoney"] != null && ds.Tables[0].Rows[0]["LassMoney"].ToString() != "")
                {
                    model.LassMoney = decimal.Parse(ds.Tables[0].Rows[0]["LassMoney"].ToString());
                }
                if (ds.Tables[0].Rows[0]["Royalty"] != null && ds.Tables[0].Rows[0]["Royalty"].ToString() != "")
                {
                    model.Royalty = decimal.Parse(ds.Tables[0].Rows[0]["Royalty"].ToString());
                }
                model.Image = ds.Tables[0].Rows[0]["Image"].ToString();
                if (ds.Tables[0].Rows[0]["IsUse"] != null && ds.Tables[0].Rows[0]["IsUse"].ToString() != "")
                {
                    if ((ds.Tables[0].Rows[0]["IsUse"].ToString() == "1") || (ds.Tables[0].Rows[0]["IsUse"].ToString().ToLower() == "true"))
                    {
                        model.IsUse = true;
                    }
                    else
                    {
                        model.IsUse = false;
                    }
                }
                if (ds.Tables[0].Rows[0]["City"] != null && ds.Tables[0].Rows[0]["City"].ToString() != "")
                {
                    model.City = int.Parse(ds.Tables[0].Rows[0]["City"].ToString());
                }
                if (ds.Tables[0].Rows[0]["County"] != null && ds.Tables[0].Rows[0]["County"].ToString() != "")
                {
                    model.County = int.Parse(ds.Tables[0].Rows[0]["County"].ToString());
                }
                model.Remark = ds.Tables[0].Rows[0]["Remark"].ToString();
                if (ds.Tables[0].Rows[0]["IDCardID"] != null && ds.Tables[0].Rows[0]["IDCardID"].ToString() != "")
                {
                    model.IDCardID = long.Parse(ds.Tables[0].Rows[0]["IDCardID"].ToString());
                }
                if (ds.Tables[0].Rows[0]["IsEnd"] != null && ds.Tables[0].Rows[0]["IsEnd"].ToString() != "")
                {
                    model.IsEnd = int.Parse(ds.Tables[0].Rows[0]["IsEnd"].ToString());
                }
                if (ds.Tables[0].Rows[0]["Deposit"] != null && ds.Tables[0].Rows[0]["Deposit"].ToString() != "")
                {
                    model.Deposit = decimal.Parse(ds.Tables[0].Rows[0]["Deposit"].ToString());
                }
                if (ds.Tables[0].Rows[0]["NeedDeposit"] != null && ds.Tables[0].Rows[0]["NeedDeposit"].ToString() != "")
                {
                    model.NeedDeposit = decimal.Parse(ds.Tables[0].Rows[0]["NeedDeposit"].ToString());
                }
                model.DefaultWorkType = ds.Tables[0].Rows[0]["DefaultWorkType"].ToString();
                if (ds.Tables[0].Rows[0]["BoardWages"] != null && ds.Tables[0].Rows[0]["BoardWages"].ToString() != "")
                {
                    model.BoardWages = decimal.Parse(ds.Tables[0].Rows[0]["BoardWages"].ToString());
                }
                if (ds.Tables[0].Rows[0]["HeTongDate"] != null && ds.Tables[0].Rows[0]["HeTongDate"].ToString() != "")
                {
                    model.HeTongDate = DateTime.Parse(ds.Tables[0].Rows[0]["HeTongDate"].ToString());
                }
                model.HeTongAmount = ds.Tables[0].Rows[0]["HeTongAmount"].ToString();
                if (ds.Tables[0].Rows[0]["HeTongDQDate"] != null && ds.Tables[0].Rows[0]["HeTongDQDate"].ToString() != "")
                {
                    model.HeTongDQDate = DateTime.Parse(ds.Tables[0].Rows[0]["HeTongDQDate"].ToString());
                }
                if (ds.Tables[0].Rows[0]["IsCaicTiCheng"] != null && ds.Tables[0].Rows[0]["IsCaicTiCheng"].ToString() != "")
                {
                    if ((ds.Tables[0].Rows[0]["IsCaicTiCheng"].ToString() == "1") || (ds.Tables[0].Rows[0]["IsCaicTiCheng"].ToString().ToLower() == "true"))
                    {
                        model.IsCaicTiCheng = true;
                    }
                    else
                    {
                        model.IsCaicTiCheng = false;
                    }
                }
                if (ds.Tables[0].Rows[0]["MaxAmountDay"] != null && ds.Tables[0].Rows[0]["MaxAmountDay"].ToString() != "")
                {
                    model.MaxAmountDay = int.Parse(ds.Tables[0].Rows[0]["MaxAmountDay"].ToString());
                }
                model.BankNO          = ds.Tables[0].Rows[0]["BankNO"].ToString();
                model.BankAccountName = ds.Tables[0].Rows[0]["BankAccountName"].ToString();
                model.BankName        = ds.Tables[0].Rows[0]["BankName"].ToString();
                model.A = 1;
                return(model);
            }
            else
            {
                return(null);
            }
        }
コード例 #4
0
ファイル: MiniEmp.cs プロジェクト: miradel51/HownetServer
        /// <summary>
        /// 更新一条数据
        /// </summary>
        public bool Update(Hownet.Model.MiniEmp model)
        {
            StringBuilder strSql = new StringBuilder();

            strSql.Append("update MiniEmp set ");
            strSql.Append("Name=@Name,");
            strSql.Append("IntroducerID=@IntroducerID,");
            strSql.Append("IdentityCard=@IdentityCard,");
            strSql.Append("Sex=@Sex,");
            strSql.Append("Sn=@Sn,");
            strSql.Append("Province=@Province,");
            strSql.Append("Address=@Address,");
            strSql.Append("Phone=@Phone,");
            strSql.Append("AccDate=@AccDate,");
            strSql.Append("WorkTypeID=@WorkTypeID,");
            strSql.Append("PayID=@PayID,");
            strSql.Append("DimDate=@DimDate,");
            strSql.Append("BedID=@BedID,");
            strSql.Append("TableID=@TableID,");
            strSql.Append("DepartmentID=@DepartmentID,");
            strSql.Append("DegreeID=@DegreeID,");
            strSql.Append("PolityID=@PolityID,");
            strSql.Append("SOSPhone=@SOSPhone,");
            strSql.Append("SOSMan=@SOSMan,");
            strSql.Append("NowAddress=@NowAddress,");
            strSql.Append("FillDate=@FillDate,");
            strSql.Append("FillUser=@FillUser,");
            strSql.Append("LassMoney=@LassMoney,");
            strSql.Append("Royalty=@Royalty,");
            strSql.Append("Image=@Image,");
            strSql.Append("IsUse=@IsUse,");
            strSql.Append("City=@City,");
            strSql.Append("County=@County,");
            strSql.Append("Remark=@Remark,");
            strSql.Append("IDCardID=@IDCardID,");
            strSql.Append("IsEnd=@IsEnd,");
            strSql.Append("Deposit=@Deposit,");
            strSql.Append("NeedDeposit=@NeedDeposit,");
            strSql.Append("DefaultWorkType=@DefaultWorkType,");
            strSql.Append("BoardWages=@BoardWages,");
            strSql.Append("HeTongDate=@HeTongDate,");
            strSql.Append("HeTongAmount=@HeTongAmount,");
            strSql.Append("HeTongDQDate=@HeTongDQDate,");
            strSql.Append("IsCaicTiCheng=@IsCaicTiCheng,");
            strSql.Append("MaxAmountDay=@MaxAmountDay,");
            strSql.Append("BankNO=@BankNO,");
            strSql.Append("BankAccountName=@BankAccountName,");
            strSql.Append("BankName=@BankName");
            strSql.Append(" where ID=@ID");
            SqlParameter[] parameters =
            {
                new SqlParameter("@Name",            SqlDbType.NVarChar,    12),
                new SqlParameter("@IntroducerID",    SqlDbType.Int,          4),
                new SqlParameter("@IdentityCard",    SqlDbType.NVarChar,    18),
                new SqlParameter("@Sex",             SqlDbType.TinyInt,      1),
                new SqlParameter("@Sn",              SqlDbType.NVarChar,    11),
                new SqlParameter("@Province",        SqlDbType.Int,          4),
                new SqlParameter("@Address",         SqlDbType.NVarChar,   255),
                new SqlParameter("@Phone",           SqlDbType.NVarChar,    18),
                new SqlParameter("@AccDate",         SqlDbType.DateTime),
                new SqlParameter("@WorkTypeID",      SqlDbType.NVarChar,   200),
                new SqlParameter("@PayID",           SqlDbType.Int,          4),
                new SqlParameter("@DimDate",         SqlDbType.DateTime),
                new SqlParameter("@BedID",           SqlDbType.Int,          4),
                new SqlParameter("@TableID",         SqlDbType.Int,          4),
                new SqlParameter("@DepartmentID",    SqlDbType.Int,          4),
                new SqlParameter("@DegreeID",        SqlDbType.Int,          4),
                new SqlParameter("@PolityID",        SqlDbType.Int,          4),
                new SqlParameter("@SOSPhone",        SqlDbType.NVarChar,    18),
                new SqlParameter("@SOSMan",          SqlDbType.NVarChar,    12),
                new SqlParameter("@NowAddress",      SqlDbType.NVarChar,    50),
                new SqlParameter("@FillDate",        SqlDbType.DateTime),
                new SqlParameter("@FillUser",        SqlDbType.Int,          4),
                new SqlParameter("@LassMoney",       SqlDbType.Decimal,      9),
                new SqlParameter("@Royalty",         SqlDbType.Decimal,      9),
                new SqlParameter("@Image",           SqlDbType.NVarChar,    50),
                new SqlParameter("@IsUse",           SqlDbType.Bit,          1),
                new SqlParameter("@City",            SqlDbType.Int,          4),
                new SqlParameter("@County",          SqlDbType.Int,          4),
                new SqlParameter("@Remark",          SqlDbType.NVarChar,  2000),
                new SqlParameter("@IDCardID",        SqlDbType.BigInt,       8),
                new SqlParameter("@IsEnd",           SqlDbType.Int,          4),
                new SqlParameter("@Deposit",         SqlDbType.Decimal,      9),
                new SqlParameter("@NeedDeposit",     SqlDbType.Decimal,      9),
                new SqlParameter("@DefaultWorkType", SqlDbType.NVarChar,   500),
                new SqlParameter("@BoardWages",      SqlDbType.Decimal,      9),
                new SqlParameter("@HeTongDate",      SqlDbType.DateTime),
                new SqlParameter("@HeTongAmount",    SqlDbType.NVarChar,    50),
                new SqlParameter("@HeTongDQDate",    SqlDbType.DateTime),
                new SqlParameter("@IsCaicTiCheng",   SqlDbType.Bit,          1),
                new SqlParameter("@MaxAmountDay",    SqlDbType.Int,          4),
                new SqlParameter("@BankNO",          SqlDbType.NVarChar,    50),
                new SqlParameter("@BankAccountName", SqlDbType.NVarChar,    50),
                new SqlParameter("@BankName",        SqlDbType.NVarChar,    50),
                new SqlParameter("@ID",              SqlDbType.Int, 4)
            };
            parameters[0].Value  = model.Name;
            parameters[1].Value  = model.IntroducerID;
            parameters[2].Value  = model.IdentityCard;
            parameters[3].Value  = model.Sex;
            parameters[4].Value  = model.Sn;
            parameters[5].Value  = model.Province;
            parameters[6].Value  = model.Address;
            parameters[7].Value  = model.Phone;
            parameters[8].Value  = model.AccDate;
            parameters[9].Value  = model.WorkTypeID;
            parameters[10].Value = model.PayID;
            parameters[11].Value = model.DimDate;
            parameters[12].Value = model.BedID;
            parameters[13].Value = model.TableID;
            parameters[14].Value = model.DepartmentID;
            parameters[15].Value = model.DegreeID;
            parameters[16].Value = model.PolityID;
            parameters[17].Value = model.SOSPhone;
            parameters[18].Value = model.SOSMan;
            parameters[19].Value = model.NowAddress;
            parameters[20].Value = model.FillDate;
            parameters[21].Value = model.FillUser;
            parameters[22].Value = model.LassMoney;
            parameters[23].Value = model.Royalty;
            parameters[24].Value = model.Image;
            parameters[25].Value = model.IsUse;
            parameters[26].Value = model.City;
            parameters[27].Value = model.County;
            parameters[28].Value = model.Remark;
            parameters[29].Value = model.IDCardID;
            parameters[30].Value = model.IsEnd;
            parameters[31].Value = model.Deposit;
            parameters[32].Value = model.NeedDeposit;
            parameters[33].Value = model.DefaultWorkType;
            parameters[34].Value = model.BoardWages;
            parameters[35].Value = model.HeTongDate;
            parameters[36].Value = model.HeTongAmount;
            parameters[37].Value = model.HeTongDQDate;
            parameters[38].Value = model.IsCaicTiCheng;
            parameters[39].Value = model.MaxAmountDay;
            parameters[40].Value = model.BankNO;
            parameters[41].Value = model.BankAccountName;
            parameters[42].Value = model.BankName;
            parameters[43].Value = model.ID;

            int rows = DbHelperSQL.ExecuteSql(strSql.ToString(), parameters);

            if (rows > 0)
            {
                return(true);
            }
            else
            {
                return(false);
            }
        }
コード例 #5
0
        public string EmpAddWork(string TicketInfoID, string EmpID, string TicketTime)
        {
            if (TicketInfoID == string.Empty || TicketTime == string.Empty)
            {
                return("工序卡刷卡不正确");
            }
            if (Convert.ToDateTime(TicketTime).AddSeconds(30) < DateTime.Now)
            {
                return("刷卡超时");
            }
            if (EmpID == string.Empty)
            {
                return(string.Empty);
            }
            try
            {
                Hownet.BLL.MiniEmp   bllME = new Hownet.BLL.MiniEmp();
                Hownet.Model.MiniEmp modME = bllME.GetModel(Convert.ToInt32(EmpID));
                if (modME == null)
                {
                    return("员工不正确");
                }
                if (Convert.ToDateTime(modME.DimDate) > Convert.ToDateTime("1900-1-1"))
                {
                    return("员工已离职!");
                }
                Hownet.BLL.WorkTicketInfo   bllWTI = new Hownet.BLL.WorkTicketInfo();
                Hownet.Model.WorkTicketInfo modWTI = bllWTI.GetModel(Convert.ToInt32(TicketInfoID));
                if (modWTI == null)
                {
                    return("工序卡刷卡不正确");
                }
                if (modWTI.EmployeeID > 0)
                {
                    return("该工序已被完成");
                }
                Hownet.BLL.Working   bllW = new Hownet.BLL.Working();
                Hownet.Model.Working modW = bllW.GetModel(modWTI.WorkingID);
                if (!CheckWorkType(modW.WorkTypeID.ToString(), modME.WorkTypeID))
                {
                    return("工种不匹配");
                }
                DateTime dtNow = DateTime.Now;
                Hownet.BLL.ProductTaskMain   bllPTM = new Hownet.BLL.ProductTaskMain();
                Hownet.Model.ProductTaskMain modPTM = bllPTM.GetModel(modWTI.TaskID);
                bllWTI.GetBarBack(modWTI.ID, modME.ID, dtNow, 1);
                bllWTI.AddPayInfo(modPTM.MaterielID, modWTI.ID, modPTM.DateTime.ToString("yyyyMMdd") + modPTM.Num.ToString().PadLeft(3, '0'));
                DataRow[] drs = ReaderCard.BasicTable.dtWTCard.Select("(InfoID=" + TicketInfoID + ")");
                if (drs.Length == 1)
                {
                    drs[0]["EmployeeID"]  = modME.ID;
                    drs[0]["MiniEmpName"] = modME.Name;
                    drs[0]["DateTime"]    = DateTime.Now;
                }

                if (modWTI.WorkingID == BasicTable.BackDepotWorkingID)
                {
                    Hownet.BLL.WorkTicket   bllWT = new Hownet.BLL.WorkTicket();
                    Hownet.Model.WorkTicket modWT = bllWT.GetModel(modWTI.MainID);
                    if (modWT.P2DInfoID == 0)
                    {
                        Hownet.BLL.AmountInfo          bllAI = new Hownet.BLL.AmountInfo();
                        List <Hownet.Model.AmountInfo> liAI  = bllAI.GetModelList("(MainID=" + modWT.TaskID + ") And (TableTypeID=1) And (MListID=" + modWT.MListID + ")");
                        if (liAI.Count > 0)
                        {
                            liAI[0].NotAmount -= modWT.Amount;
                            bllAI.Update(liAI[0]);
                        }
                    }
                }
                return("今天总产量:" + bllWTI.CountAmount(modME.ID, dtNow, ReaderCard.BasicTable.IsShowMoney).ToString());
            }
            catch
            {
                return("对不起,出现错误!");
            }
            //return string.Empty;
        }
コード例 #6
0
ファイル: Services.cs プロジェクト: miradel51/HownetServer
        public string Ordering(string EID)
        {
            try
            {
                int _eid = Convert.ToInt32(EID);
            }
            catch
            {
                return("员工不正确");
            }
            bool t = false;

            Hownet.BLL.MiniEmp   bllME = new Hownet.BLL.MiniEmp();
            Hownet.Model.MiniEmp modME = bllME.GetModel(Convert.ToInt32(EID));
            if (modME == null)
            {
                return("员工不正确");
            }
            if (Convert.ToDateTime(modME.DimDate) > Convert.ToDateTime("1900-1-1"))
            {
                return("员工已离职!");
            }
            string mes      = string.Empty;
            int    olTypeID = GetTypeID();

            if (olTypeID < 4)
            {
                DataTable dtOL = new DataTable();
                Hownet.BLL.OrderingList   bllOL = new Hownet.BLL.OrderingList();
                Hownet.Model.OrderingList modOL;
                if (BasicTable.modST.OderOne > BasicTable.modST.OderThree && olTypeID == 1)
                {
                    dtOL = bllOL.GetList("(EmployeeID=" + EID + ") And (DateTime='" + DateTime.Today.AddDays(BasicTable.modST.OrderDays + 1) + "')").Tables[0];
                }
                else
                {
                    dtOL = bllOL.GetList("(EmployeeID=" + EID + ") And (DateTime='" + DateTime.Today.AddDays(BasicTable.modST.OrderDays) + "')").Tables[0];
                }
                if (dtOL.Rows.Count == 0)
                {
                    modOL            = new Hownet.Model.OrderingList();
                    modOL.EmployeeID = Convert.ToInt32(EID);
                    modOL.DateTime   = DateTime.Today.AddDays(BasicTable.modST.OrderDays);
                    if (olTypeID == 1)
                    {
                        if (BasicTable.modST.OderOne > BasicTable.modST.OderThree)
                        {
                            modOL.DateTime = DateTime.Today.AddDays(BasicTable.modST.OrderDays + 1);
                        }
                        modOL.OrderOne      = 1;
                        modOL.DinOne        = modOL.OrderTwo = modOL.DinTwo = modOL.OrderThree = modOL.DinThree = 0;
                        modOL.OrderOneTime  = DateTime.Now;
                        modOL.DiningOneTime = modOL.OrdeTwoTime = modOL.DiningTwoTime = modOL.OrdeThreeTime = modOL.DiningThreeTime = DateTime.Parse("1900-1-1");
                        modOL.OrderCount    = 1;
                        modOL.DinCount      = 0;
                    }
                    else if (olTypeID == 2)
                    {
                        modOL.OrderTwo      = 1;
                        modOL.DinOne        = modOL.OrderOne = modOL.DinTwo = modOL.OrderThree = modOL.DinThree = 0;
                        modOL.OrdeTwoTime   = DateTime.Now;
                        modOL.DiningOneTime = modOL.OrderOneTime = modOL.DiningTwoTime = modOL.OrdeThreeTime = modOL.DiningThreeTime = DateTime.Parse("1900-1-1");
                        modOL.OrderCount    = 1;
                        modOL.DinCount      = 0;
                    }
                    else if (olTypeID == 3)
                    {
                        modOL.OrderThree    = 1;
                        modOL.DinOne        = modOL.OrderOne = modOL.DinTwo = modOL.OrderTwo = modOL.DinThree = 0;
                        modOL.OrdeThreeTime = DateTime.Now;
                        modOL.DiningOneTime = modOL.OrderOneTime = modOL.DiningTwoTime = modOL.OrdeTwoTime = modOL.DiningThreeTime = DateTime.Parse("1900-1-1");
                        modOL.OrderCount    = 1;
                        modOL.DinCount      = 0;
                    }
                    bllOL.Add(modOL);
                }
                else
                {
                    modOL = bllOL.GetModel(Convert.ToInt32(dtOL.Rows[0]["ID"]));
                    if (olTypeID == 1)
                    {
                        if (modOL.OrderOne == 0)
                        {
                            modOL.OrderOne     = 1;
                            modOL.OrderOneTime = DateTime.Now;
                            t = true;
                        }
                    }
                    else if (olTypeID == 2)
                    {
                        if (modOL.OrderTwo == 0)
                        {
                            modOL.OrderTwo    = 1;
                            modOL.OrdeTwoTime = DateTime.Now;
                            t = true;
                        }
                    }
                    else if (olTypeID == 3)
                    {
                        if (modOL.OrderThree == 0)
                        {
                            modOL.OrderThree    = 1;
                            modOL.OrdeThreeTime = DateTime.Now;
                            t = true;
                        }
                    }
                }
                if (t)
                {
                    modOL.OrderCount += 1;
                    bllOL.Update(modOL);
                }
                mes = modME.Name + "  预订";

                if (BasicTable.modST.OderOne > BasicTable.modST.OderThree && olTypeID == 1)
                {
                    mes = mes + DateTime.Today.AddDays(BasicTable.modST.OrderDays + 1).Day.ToString() + "日";
                }
                else
                {
                    mes = mes + DateTime.Today.AddDays(BasicTable.modST.OrderDays).Day.ToString() + "日";
                }
                if (olTypeID == 1)
                {
                    mes = mes + "早餐";
                }
                if (olTypeID == 2)
                {
                    mes = mes + "午餐";
                }
                if (olTypeID == 3)
                {
                    mes = mes + "晚餐";
                }
                mes = mes + "成功";
            }
            else
            {
                mes = "已经打烊不订餐了";
            }
            return(mes);
        }