Пример #1
0
    protected void GetPageData()
    {
        SalaryTModel model = this.sta.GetModel(this.rid);

        this.txtTempletName.Text        = model.TempletName;
        this.DDLClassCode.SelectedValue = model.ClassCode;
    }
Пример #2
0
        public int Update(SalaryTModel model)
        {
            StringBuilder builder = new StringBuilder();

            builder.Append("update HR_Salary_Templet set ");
            builder.Append("TempletName='" + model.TempletName + "',");
            builder.Append("UseState=" + model.UseState + ",");
            builder.Append("UserCode='" + model.UserCode + "',");
            builder.Append("RecordDate='" + model.RecordDate + "',");
            builder.Append("ClassCode='" + model.ClassCode + "',");
            builder.Append("BeginDate='" + model.BeginDate + "',");
            builder.Append("EndDate='" + model.EndDate + "'");
            builder.Append(" where TempletID=" + model.TempletID + " ");
            return(publicDbOpClass.ExecSqlString(builder.ToString()));
        }
Пример #3
0
        public int Add(SalaryTModel model)
        {
            StringBuilder builder = new StringBuilder();

            builder.Append("insert into HR_Salary_Templet(");
            builder.Append("TempletName,UseState,UserCode,RecordDate,ClassCode,BeginDate,EndDate");
            builder.Append(")");
            builder.Append(" values (");
            builder.Append("'" + model.TempletName + "',");
            builder.Append(model.UseState + ",");
            builder.Append("'" + model.UserCode + "',");
            builder.Append("'" + model.RecordDate + "',");
            builder.Append("'" + model.ClassCode + "',");
            builder.Append("'" + model.BeginDate + "',");
            builder.Append("'" + model.EndDate + "'");
            builder.Append(")");
            builder.Append(";select @@IDENTITY");
            return(publicDbOpClass.ExecSqlString(builder.ToString()));
        }
Пример #4
0
        public SalaryTModel GetModel(int TempletID)
        {
            StringBuilder builder = new StringBuilder();

            builder.Append("select   ");
            builder.Append(" TempletID,TempletName,UseState,UserCode,RecordDate,ClassCode,BeginDate,EndDate ");
            builder.Append(" from HR_Salary_Templet ");
            builder.Append(" where TempletID=" + TempletID + " ");
            SalaryTModel model = new SalaryTModel();
            DataSet      set   = publicDbOpClass.DataSetQuary(builder.ToString());

            if (set.Tables[0].Rows.Count <= 0)
            {
                return(null);
            }
            if (set.Tables[0].Rows[0]["TempletID"].ToString() != "")
            {
                model.TempletID = int.Parse(set.Tables[0].Rows[0]["TempletID"].ToString());
            }
            model.TempletName = set.Tables[0].Rows[0]["TempletName"].ToString();
            if (set.Tables[0].Rows[0]["UseState"].ToString() != "")
            {
                model.UseState = new int?(int.Parse(set.Tables[0].Rows[0]["UseState"].ToString()));
            }
            model.UserCode = set.Tables[0].Rows[0]["UserCode"].ToString();
            if (set.Tables[0].Rows[0]["RecordDate"].ToString() != "")
            {
                model.RecordDate = new DateTime?(DateTime.Parse(set.Tables[0].Rows[0]["RecordDate"].ToString()));
            }
            model.ClassCode = set.Tables[0].Rows[0]["ClassCode"].ToString();
            if (set.Tables[0].Rows[0]["BeginDate"].ToString() != "")
            {
                model.BeginDate = new DateTime?(DateTime.Parse(set.Tables[0].Rows[0]["BeginDate"].ToString()));
            }
            if (set.Tables[0].Rows[0]["EndDate"].ToString() != "")
            {
                model.EndDate = new DateTime?(DateTime.Parse(set.Tables[0].Rows[0]["EndDate"].ToString()));
            }
            return(model);
        }