protected void GetPageData() { SalarySAModel model = this.sia.GetModel(this.InstanceCode); userManageDb userManageDb = new userManageDb(); this.LbEmployeeCode.Text = userManageDb.GetUserName(model.EmployeeCode); this.LbDeptName.Text = model.DeptName; this.LbDutyName.Text = model.DutyName; this.LbNewSalary.Text = model.NewSalary.ToString(); this.LbOldSalary.Text = model.OldSalary.ToString(); this.LbAdjustReason.Text = model.AdjustReason; this.LbRemark.Text = model.Remark; }
protected void GetPageData() { SalarySAModel model = this.sia.GetModel(this.rid); this.hdnEmployeeCode.Value = model.EmployeeCode; userManageDb userManageDb = new userManageDb(); this.txtEmployeeCode.Text = userManageDb.GetUserName(model.EmployeeCode); this.txtDeptName.Text = model.DeptName; this.txtDutyName.Text = model.DutyName; this.txtNewSalary.Text = model.NewSalary.ToString(); this.txtOldSalary.Text = model.OldSalary.ToString(); this.txtAdjustReason.Text = model.AdjustReason; this.txtRemark.Text = model.Remark; }
public SalarySAModel GetModel(Guid RecordID) { StringBuilder builder = new StringBuilder(); builder.Append("select "); builder.Append(" RecordID,AuditState,EmployeeCode,DeptName,DutyName,OldSalary,NewSalary,IsConfirm,UserCode,RecordDate,AdjustReason,Remark "); builder.Append(" from HR_Salary_SingleAdjust "); builder.Append(" where RecordID='" + RecordID + "' "); SalarySAModel model = new SalarySAModel(); DataSet set = publicDbOpClass.DataSetQuary(builder.ToString()); if (set.Tables[0].Rows.Count <= 0) { return(null); } if (set.Tables[0].Rows[0]["RecordID"].ToString() != "") { model.RecordID = new Guid(set.Tables[0].Rows[0]["RecordID"].ToString()); } if (set.Tables[0].Rows[0]["AuditState"].ToString() != "") { model.AuditState = new int?(int.Parse(set.Tables[0].Rows[0]["AuditState"].ToString())); } model.EmployeeCode = set.Tables[0].Rows[0]["EmployeeCode"].ToString(); model.DeptName = set.Tables[0].Rows[0]["DeptName"].ToString(); model.DutyName = set.Tables[0].Rows[0]["DutyName"].ToString(); if (set.Tables[0].Rows[0]["OldSalary"].ToString() != "") { model.OldSalary = new decimal?(decimal.Parse(set.Tables[0].Rows[0]["OldSalary"].ToString())); } if (set.Tables[0].Rows[0]["NewSalary"].ToString() != "") { model.NewSalary = new decimal?(decimal.Parse(set.Tables[0].Rows[0]["NewSalary"].ToString())); } model.IsConfirm = set.Tables[0].Rows[0]["IsConfirm"].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.AdjustReason = set.Tables[0].Rows[0]["AdjustReason"].ToString(); model.Remark = set.Tables[0].Rows[0]["Remark"].ToString(); return(model); }
public int Update(SalarySAModel model) { StringBuilder builder = new StringBuilder(); builder.Append("update HR_Salary_SingleAdjust set "); builder.Append("AuditState=" + model.AuditState + ","); builder.Append("EmployeeCode='" + model.EmployeeCode + "',"); builder.Append("DeptName='" + model.DeptName + "',"); builder.Append("DutyName='" + model.DutyName + "',"); builder.Append("OldSalary=" + model.OldSalary + ","); builder.Append("NewSalary=" + model.NewSalary + ","); builder.Append("IsConfirm='" + model.IsConfirm + "',"); builder.Append("UserCode='" + model.UserCode + "',"); builder.Append("RecordDate='" + model.RecordDate + "',"); builder.Append("AdjustReason='" + model.AdjustReason + "',"); builder.Append("Remark='" + model.Remark + "'"); builder.Append(" where RecordID='" + model.RecordID + "' "); return(publicDbOpClass.ExecSqlString(builder.ToString())); }
public int Add(SalarySAModel model) { StringBuilder builder = new StringBuilder(); builder.Append("insert into HR_Salary_SingleAdjust("); builder.Append("AuditState,EmployeeCode,DeptName,DutyName,OldSalary,NewSalary,IsConfirm,UserCode,RecordDate,AdjustReason,Remark"); builder.Append(")"); builder.Append(" values ("); builder.Append(model.AuditState + ","); builder.Append("'" + model.EmployeeCode + "',"); builder.Append("'" + model.DeptName + "',"); builder.Append("'" + model.DutyName + "',"); builder.Append(model.OldSalary + ","); builder.Append(model.NewSalary + ","); builder.Append("'" + model.IsConfirm + "',"); builder.Append("'" + model.UserCode + "',"); builder.Append("'" + model.RecordDate + "',"); builder.Append("'" + model.AdjustReason + "',"); builder.Append("'" + model.Remark + "'"); builder.Append(")"); return(publicDbOpClass.ExecSqlString(builder.ToString())); }