private void cmdSave_Click(object sender, EventArgs e) { SqlQuery sqlQuery = new Select().From(SysManagementUnit.Schema) .Where(SysManagementUnit.Columns.PkSBranchID).IsEqualTo("LIS"); if (sqlQuery.GetRecordCount() <= 0) { //LDonVi.Insert("LIS", txtDonViCapTren.Text, txtDonVi.Text, txtDiaChi.Text, txtDienThoai.Text); SysManagementUnit objSysManagementUnit = new SysManagementUnit(); objSysManagementUnit.PkSBranchID = "LIS"; objSysManagementUnit.SName = txtDonVi.Text; objSysManagementUnit.SParentBranchName = txtDonViCapTren.Text; objSysManagementUnit.SAddress = txtDiaChi.Text; objSysManagementUnit.SPhone = txtDienThoai.Text; objSysManagementUnit.IsNew = true; objSysManagementUnit.Save(); } else { SysManagementUnit objSysManagementUnit = new SysManagementUnit(); objSysManagementUnit.MarkOld(); objSysManagementUnit.IsLoaded = true; objSysManagementUnit.PkSBranchID = "LIS"; objSysManagementUnit.SName = txtDonVi.Text; objSysManagementUnit.SParentBranchName = txtDonViCapTren.Text; objSysManagementUnit.SAddress = txtDiaChi.Text; objSysManagementUnit.SPhone = txtDienThoai.Text; // objSysManagementUnit.IsNew = true; objSysManagementUnit.Save(); } Utility.ShowMsg("Bạn thực hiện lưu thành công","Thông báo"); }
private void cmdSave_Click(object sender, EventArgs e) { SqlQuery sqlQuery = new Select().From(SysManagementUnit.Schema) .Where(SysManagementUnit.Columns.PkSBranchID).IsEqualTo("LIS"); if (sqlQuery.GetRecordCount() <= 0) { //LDonVi.Insert("LIS", txtDonViCapTren.Text, txtDonVi.Text, txtDiaChi.Text, txtDienThoai.Text); SysManagementUnit objSysManagementUnit = new SysManagementUnit(); objSysManagementUnit.PkSBranchID = "LIS"; objSysManagementUnit.SName = txtDonVi.Text; objSysManagementUnit.SParentBranchName = txtDonViCapTren.Text; objSysManagementUnit.SAddress = txtDiaChi.Text; objSysManagementUnit.SPhone = txtDienThoai.Text; objSysManagementUnit.IsNew = true; objSysManagementUnit.Save(); } else { SysManagementUnit objSysManagementUnit = new SysManagementUnit(); objSysManagementUnit.MarkOld(); objSysManagementUnit.IsLoaded = true; objSysManagementUnit.PkSBranchID = "LIS"; objSysManagementUnit.SName = txtDonVi.Text; objSysManagementUnit.SParentBranchName = txtDonViCapTren.Text; objSysManagementUnit.SAddress = txtDiaChi.Text; objSysManagementUnit.SPhone = txtDienThoai.Text; // objSysManagementUnit.IsNew = true; objSysManagementUnit.Save(); } Utility.ShowMsg("Bạn thực hiện lưu thành công", "Thông báo"); }
public void Insert(string PkSBranchID,string SName,string SParentBranchName,string FpSUpBranchID,int? IntLevel,string SAddress,string SPhone,string SBussinessPhone,string SHotPhone,string SDutyPhone,string SFAX,string SEMAIL,string STaxCode,string SAccountID,string SRepresentative,string SPosition,string SProxyNumber,DateTime? TDateMandate,string SMandateUnitName,string SMandateUnitAddress,DateTime? TInvalidDate,DateTime? TInputDate,string STyper,string SBankCode,string SLandSurveyUnitCode,string Website) { SysManagementUnit item = new SysManagementUnit(); item.PkSBranchID = PkSBranchID; item.SName = SName; item.SParentBranchName = SParentBranchName; item.FpSUpBranchID = FpSUpBranchID; item.IntLevel = IntLevel; item.SAddress = SAddress; item.SPhone = SPhone; item.SBussinessPhone = SBussinessPhone; item.SHotPhone = SHotPhone; item.SDutyPhone = SDutyPhone; item.SFAX = SFAX; item.SEMAIL = SEMAIL; item.STaxCode = STaxCode; item.SAccountID = SAccountID; item.SRepresentative = SRepresentative; item.SPosition = SPosition; item.SProxyNumber = SProxyNumber; item.TDateMandate = TDateMandate; item.SMandateUnitName = SMandateUnitName; item.SMandateUnitAddress = SMandateUnitAddress; item.TInvalidDate = TInvalidDate; item.TInputDate = TInputDate; item.STyper = STyper; item.SBankCode = SBankCode; item.SLandSurveyUnitCode = SLandSurveyUnitCode; item.Website = Website; item.Save(UserName); }
public void Insert(string PkSBranchID, string SName, string SParentBranchName, string FpSUpBranchID, int?IntLevel, string SAddress, string SPhone, string SBussinessPhone, string SHotPhone, string SDutyPhone, string SFAX, string SEMAIL, string STaxCode, string SAccountID, string SRepresentative, string SPosition, string SProxyNumber, DateTime?TDateMandate, string SMandateUnitName, string SMandateUnitAddress, DateTime?TInvalidDate, DateTime?TInputDate, string STyper, string SBankCode, string SLandSurveyUnitCode, string Website, byte[] Logo) { SysManagementUnit item = new SysManagementUnit(); item.PkSBranchID = PkSBranchID; item.SName = SName; item.SParentBranchName = SParentBranchName; item.FpSUpBranchID = FpSUpBranchID; item.IntLevel = IntLevel; item.SAddress = SAddress; item.SPhone = SPhone; item.SBussinessPhone = SBussinessPhone; item.SHotPhone = SHotPhone; item.SDutyPhone = SDutyPhone; item.SFAX = SFAX; item.SEMAIL = SEMAIL; item.STaxCode = STaxCode; item.SAccountID = SAccountID; item.SRepresentative = SRepresentative; item.SPosition = SPosition; item.SProxyNumber = SProxyNumber; item.TDateMandate = TDateMandate; item.SMandateUnitName = SMandateUnitName; item.SMandateUnitAddress = SMandateUnitAddress; item.TInvalidDate = TInvalidDate; item.TInputDate = TInputDate; item.STyper = STyper; item.SBankCode = SBankCode; item.SLandSurveyUnitCode = SLandSurveyUnitCode; item.Website = Website; item.Logo = Logo; item.Save(UserName); }