protected void grid_RowUpdating(object sender, DevExpress.Web.Data.ASPxDataUpdatingEventArgs e) { //ASPxTextBox txtCode = grid.FindEditFormTemplateControl("txtCode") as ASPxTextBox; ASPxTextBox txtTitle = grid.FindEditFormTemplateControl("txtTitle") as ASPxTextBox; ASPxTextBox txtCoefficient = grid.FindEditFormTemplateControl("txtCoefficient") as ASPxTextBox; ASPxTextBox textId = grid.FindEditFormTemplateControl("txtId") as ASPxTextBox; ASPxDateEdit txtDateEffectted = grid.FindEditFormTemplateControl("txtDateEffectted") as ASPxDateEdit; ASPxComboBox cboPositionGroup = grid.FindEditFormTemplateControl("cboPositionGroup") as ASPxComboBox; this.salary = objSalary.GetSalaryType(Int32.Parse(textId.Text)); if (this.salary != null) { if (hiddenIDBacLuong.Value != null) { if (objSalary.GetACoefficientByParentId(Convert.ToInt32(hiddenIDBacLuong.Value), Convert.ToDateTime("01/01/1900"), 0).Count == 0) { this.salary.id = -1; this.salary.title = txtTitle.Text; this.salary.parentid = Convert.ToInt32(hiddenIDBacLuong.Value); this.salary.coefficient = txtCoefficient.Text; this.salary.code = ""; this.salary.level = objSalary.GetSalaryType(Convert.ToInt32(hiddenIDBacLuong.Value)).level.Trim(); this.salary.dateeffectted = txtDateEffectted.Date; this.objSalary.AddSalaryType(salary); } else { //this.salary.id = ItemId; this.salary.title = txtTitle.Text; this.salary.coefficient = txtCoefficient.Text; this.salary.parentid = Convert.ToInt32(hiddenIDBacLuong.Value); this.salary.level = objSalary.GetSalaryType(Convert.ToInt32(hiddenIDBacLuong.Value)).level.Trim(); this.salary.code = ""; this.salary.dateeffectted = txtDateEffectted.Date; this.objSalary.UpdateSalaryType(salary); } } } grid.CancelEdit(); e.Cancel = true; if (hiddenIDBacLuong.Value != null) { this.grid.DataSource = objSalary.GetACoefficientByParentId(Int32.Parse(hiddenIDBacLuong.Value), Convert.ToDateTime("01/01/1900"), 0); this.grid.DataBind(); } else { if (Session["id"] != null) { this.grid.DataSource = objSalary.GetACoefficientByParentId(Int32.Parse(Session["id"].ToString()), Convert.ToDateTime("01/01/1900"), 0); this.grid.DataBind(); } } }
protected void ASPxCallbackPanel2_Callback(object source, DevExpress.Web.ASPxClasses.CallbackEventArgsBase e) { string id = e.Parameter.ToString(); if (id.Contains("u") == true) { int groupId = Int32.Parse(id.Substring(1)); this.salary = objSalary.GetSalaryType(groupId); IList list = new ArrayList(); list.Add(this.salary); this.grid.DataSource = list; this.grid.DataBind(); } }
protected void grid_RowDeleting(object sender, DevExpress.Web.Data.ASPxDataDeletingEventArgs e) { this.salary = objSalary.GetSalaryType(Int32.Parse(e.Keys[grid.KeyFieldName].ToString())); if (this.salary != null) { this.objSalary.DeleteSalaryType(salary); } grid.CancelEdit(); e.Cancel = true; if (hiddenIDBacLuong.Value != null) { this.grid.DataSource = objSalary.GetACoefficientByParentId(Int32.Parse(hiddenIDBacLuong.Value), Convert.ToDateTime("01/01/1900"), 0); this.grid.DataBind(); } else { if (Session["id"] != null) { this.grid.DataSource = objSalary.GetACoefficientByParentId(Int32.Parse(Session["id"].ToString()), Convert.ToDateTime("01/01/1900"), 0); this.grid.DataBind(); } } }
public abstract void DeleteSalaryType(SalaryTypeInfo objSalaryType);
public abstract void UpdateSalaryType(SalaryTypeInfo objSalaryType);
public abstract void AddSalaryType(SalaryTypeInfo objSalaryType);
protected void CallbackPanelBacLuong_Callback(object source, DevExpress.Web.ASPxClasses.CallbackEventArgsBase e) { string str = e.Parameter.ToString(); if (e.Parameter.Contains("u")) { ListEditItem item = cmbBacLuong.Items.FindByValue(e.Parameter.ToString().Substring(2)); if (item != null) { item.Selected = true; } else { int groupid = objSalary.GetSalaryType(Convert.ToInt32(e.Parameter.ToString().Substring(2))).groupid; ListEditItem item1 = cmbBacLuong.Items.FindByValue(groupid.ToString()); if (item1 != null) { item1.Selected = true; } else { cmbBacLuong.SelectedIndex = 0; } } } if (e.Parameter.Contains("w")) { txtBacLuong.Text = ""; } else if (e.Parameter.Contains("t")) { hiddenIdBacLuongPopup.Value = e.Parameter.ToString().Substring(2); txtBacLuong.Text = objSalary.GetSalaryType(Convert.ToInt32(e.Parameter.ToString().Substring(2))).level.Trim(); CallbackPanelBacLuong.JSProperties["cpEdit"] = true; } else if (e.Parameter.Contains("l")) { if (checkBacLuong(Convert.ToInt32(e.Parameter.ToString().Substring(2))) != true) { this.salary = objSalary.GetSalaryType(Convert.ToInt32(e.Parameter.ToString().Substring(2))); objSalary.DeleteSalaryType(salary); } else { CallbackPanelBacLuong.JSProperties["cpNoDelete"] = true; } } else if (e.Parameter.ToString() == "e") { this.salary.id = -1; this.salary.level = txtBacLuong.Text.Trim(); this.salary.groupid = Convert.ToInt32(cmbBacLuong.SelectedItem.Value); objSalary.AddSalaryType(salary); } else if (e.Parameter.ToString() == "s") { this.salary.id = hiddenIdBacLuongPopup.Value.Trim() != "" ? Convert.ToInt32(hiddenIdBacLuongPopup.Value) : 0; this.salary.level = txtBacLuong.Text.Trim(); this.salary.groupid = Convert.ToInt32(cmbBacLuong.SelectedItem.Value); objSalary.UpdateSalaryType(salary); hiddenIdBacLuongPopup.Value = ""; } }
public override void UpdateSalaryType(SalaryTypeInfo objACoefficient) { SqlHelper.ExecuteNonQuery(ConnectionString, GetFullyQualifiedName("HRM_SalaryType"), objACoefficient.id, objACoefficient.title, objACoefficient.coefficient, objACoefficient.level, objACoefficient.dateeffectted, objACoefficient.status, objACoefficient.code, objACoefficient.groupid, objACoefficient.parentid, 1); }
public void UpdateSalaryType(SalaryTypeInfo objACoefficient) { DataProvider.Instance().UpdateSalaryType(objACoefficient); }