public override void SaveRecord(SavingParemeter Paras) { DAL.tblLeaveType SaveModel = null; if (Paras.SavingInterface == SavingParemeter.eSavingInterface.AddNew || EditRecordDataSource == null) { SaveModel = new DAL.tblLeaveType(); } else { SaveModel = DALObject.FindSaveModelByPrimeKey(((LeaveTypeEditListModel)EditRecordDataSource).LeaveTypeID); if (SaveModel == null) { Paras.SavingResult = new SavingResult(); Paras.SavingResult.ExecutionResult = eExecutionResult.ValidationError; Paras.SavingResult.ValidationError = "Can not edit. Selected record not found, it may be deleted by another user."; return; } } SaveModel.LeaveTypeName = txtLeaveTypeName.Text; SaveModel.AnnualEntitledDays = Model.CommonFunctions.ParseDecimal(txtAnnualEntitledDays.Text); SaveModel.ApplicableTo = (byte)cmbApplicableTo.SelectedIndex; SaveModel.Notes = txtNotes.Text; SaveModel.IsEncashable = cmbEncashable.SelectedIndex == 0; SaveModel.CanCarryForward = cmbCarryForwardable.SelectedIndex == 0; SaveModel.IncludeWeekend = cmbIncludeWeekend.SelectedIndex == 0; SaveModel.IncludePublicHoliday = cmbIncludePublicHoliday.SelectedIndex == 0; SaveModel.Distribute = (byte)cmbLeaveDistribution.SelectedIndex; Paras.SavingResult = DALObject.SaveNewRecord(SaveModel); base.SaveRecord(Paras); }
public override void SaveRecord(SavingParemeter Paras) { Paras.SavingResult = DALObj.Save((int)lookupShift.EditValue, (DateTime?)deWEDateFrom.EditValue, ((List <EmployeeShiftAllocationViewModel>)employeeShiftAllocationViewModelBindingSource.List).Where(r => r.Selected).Select(r => r.EmployeeID).ToArray()); base.SaveRecord(Paras); }
public override void SaveRecord(SavingParemeter Paras) { Model.CommonProperties.LoginInfo.LoggedInCompany = CompanyDAL.GetCompanyDetail((int)lookupCompany.EditValue); Model.CommonProperties.LoginInfo.LoggedInFinPeriod = FinPeriodDAL.GetDetailModel((int)lookupFinPeriod.EditValue); base.SaveRecord(Paras); }
public override void SaveRecord(SavingParemeter Paras) { DAL.tblAccount SaveModel = null; if (Paras.SavingInterface == SavingParemeter.eSavingInterface.AddNew || EditRecordDataSource == null) { SaveModel = new DAL.tblAccount(); } else { SaveModel = DALObject.FindSaveModelByPrimeKey(((BankAccountEditListModel)EditRecordDataSource).BankAccountID); if (SaveModel == null) { Paras.SavingResult = new SavingResult(); Paras.SavingResult.ExecutionResult = eExecutionResult.ValidationError; Paras.SavingResult.ValidationError = "Can not edit. Selected record not found, it may be deleted by another user."; return; } } SaveModel.AccountName = txtBankAcName.Text; SaveModel.BankAccountNo = txtBankAcNo.Text; SaveModel.BankNameID = (int)lookupBank.EditValue; SaveModel.BranchID = (int)lookupBranch.EditValue; SaveModel.CurrencyID = (int?)lookupCurrency.EditValue; Paras.SavingResult = DALObject.SaveNewRecord(SaveModel); base.SaveRecord(Paras); }
public virtual void AfterSaving(SavingParemeter Paras) { if (Paras.SavingResult != null) { switch (Paras.SavingResult.ExecutionResult) { case eExecutionResult.CommitedSucessfuly: Alit.WinformControls.ToastNotification.Show(this, "Record saved successfully"); if (!String.IsNullOrWhiteSpace(Paras.SavingResult.MessageAfterSave)) { Alit.WinformControls.MessageBox.Show(this, Paras.SavingResult.MessageAfterSave, MessageBoxButtons.OK, MessageBoxIcon.Information); } break; case eExecutionResult.ErrorWhileExecuting: Alit.WinformControls.MessageBox.Show(this, (Paras.SavingResult.Exception.Message.Length > 500 ? Paras.SavingResult.Exception.Message.Substring(0, 500) : Paras.SavingResult.Exception.Message), MessageBoxButtons.OK, MessageBoxIcon.Error); break; case eExecutionResult.ValidationError: Alit.WinformControls.MessageBox.Show(this, "Can not save, please check following validation issue.\r\n\r\n" + Paras.SavingResult.ValidationError, MessageBoxButtons.OK, MessageBoxIcon.Warning); break; } } }
public override void SaveRecord(SavingParemeter Paras) { DAL.tblEmployeeWIBAClass SaveModel = null; if (Paras.SavingInterface == SavingParemeter.eSavingInterface.AddNew || EditRecordDataSource == null) { SaveModel = new DAL.tblEmployeeWIBAClass(); } else { SaveModel = DALObject.FindSaveModelByPrimeKey(((EmployeeWIBAClassEditListModel)EditRecordDataSource).EmployeeWIBAClassID); if (SaveModel == null) { Paras.SavingResult = new SavingResult(); Paras.SavingResult.ExecutionResult = eExecutionResult.ValidationError; Paras.SavingResult.ValidationError = "Can not edit. Selected record not found, it may be deleted by another user."; return; } } SaveModel.EmployeeWIBAClassName = txtEmployeeWIBAClassName.Text; //SaveModel.ISDCode = txtISDCode.Text; Paras.SavingResult = DALObject.SaveNewRecord(SaveModel); base.SaveRecord(Paras); }
public override void SaveRecord(SavingParemeter Paras) { DAL.tblBankBranch SaveModel = null; if (Paras.SavingInterface == SavingParemeter.eSavingInterface.AddNew || EditRecordDataSource == null) { SaveModel = new DAL.tblBankBranch(); } else { SaveModel = DALObject.FindSaveModelByPrimeKey(((BankBranchEditListModel)EditRecordDataSource).BankBranchID); if (SaveModel == null) { Paras.SavingResult = new SavingResult(); Paras.SavingResult.ExecutionResult = eExecutionResult.ValidationError; Paras.SavingResult.ValidationError = "Can not edit. Selected record not found, it may be deleted by another user."; return; } } SaveModel.BankBranchName = txtBranchName.Text; SaveModel.BankNameID = (int)lookupBank.EditValue; SaveModel.Address1 = txtAddressLine1.Text; SaveModel.Address2 = txtAddressLine2.Text; SaveModel.Address3 = txtAddressLine3.Text; SaveModel.CityID = (int)lookupCity.EditValue; SaveModel.PIN = txtPIN.Text; SaveModel.SortCode = txtSortCode.Text; SaveModel.SwiftCode = txtSwiftCode.Text; SaveModel.BankCode = txtBankCode.Text; Paras.SavingResult = DALObject.SaveNewRecord(SaveModel); base.SaveRecord(Paras); }
public override void SaveRecord(SavingParemeter Paras) { DAL.tblHoliday SaveModel = null; if (Paras.SavingInterface == SavingParemeter.eSavingInterface.AddNew || EditRecordDataSource == null) { SaveModel = new DAL.tblHoliday(); } else { SaveModel = DALObject.FindSaveModelByPrimeKey(((HolidayEditListModel)EditRecordDataSource).HolidayID); if (SaveModel == null) { Paras.SavingResult = new SavingResult(); Paras.SavingResult.ExecutionResult = eExecutionResult.ValidationError; Paras.SavingResult.ValidationError = "Can not edit. Selected record not found, it may be deleted by another user."; return; } } SaveModel.HolidayName = txtHolidayName.Text; SaveModel.HolidayType = (byte)cmbHolidayType.SelectedIndex; SaveModel.RepeatOnSameDate = cmbRepeatOnSameDate.SelectedIndex == 1; SaveModel.FromDate = deDateFrom.DateTime; SaveModel.ToDate = deDateTo.DateTime; SaveModel.TotalDays = Model.CommonFunctions.ParseInt(txtNofDays.Text); SaveModel.Remarks = txtRemarks.Text; Paras.SavingResult = DALObject.SaveNewRecord(SaveModel); base.SaveRecord(Paras); }
private void btnSaveFormat_Click(object sender, EventArgs e) { if (lookupFormat.EditValue == null) { MessageBox.Show("Please select format or type a new format name", "Format Saving", MessageBoxButtons.OK, MessageBoxIcon.Warning); lookupFormat.Focus(); return; } string LayoutXML = null; using (MemoryStream stream = new MemoryStream()) { advBandedGridView1.SaveLayoutToStream(stream, DevExpress.Utils.OptionsLayoutBase.FullLayout); stream.Seek(0, SeekOrigin.Begin); using (StreamReader reader = new StreamReader(stream)) { LayoutXML = reader.ReadToEnd(); } } SavingResult res = ReportDALObj.SaveFormat((int)lookupFormat.EditValue, lookupFormat.Text, LayoutXML); SavingParemeter paras = new SavingParemeter() { SavingResult = res }; AfterSaving(paras); if (res.ExecutionResult == eExecutionResult.CommitedSucessfuly && ((int?)lookupFormat.EditValue ?? 0) == -1) { LoadFormatLookup(); AssignFormatLookup(); } }
public override void SaveRecord(SavingParemeter Paras) { DAL.tblTAApprovalNoPrefix SaveModel = null; if (Paras.SavingInterface == SavingParemeter.eSavingInterface.AddNew || EditRecordDataSource == null) { SaveModel = new DAL.tblTAApprovalNoPrefix(); } else { SaveModel = DALObject.FindSaveModelByPrimeKey(((TAApprovalNoPrefixEditListModel)EditRecordDataSource).TAApprovalNoPrefixID); if (SaveModel == null) { Paras.SavingResult = new SavingResult(); Paras.SavingResult.ExecutionResult = eExecutionResult.ValidationError; Paras.SavingResult.ValidationError = "Can not edit. Selected record not found, it may be deleted by another user."; return; } } SaveModel.TAApprovalNoPrefixName = txtTAApprovalNoPrefixName.Text; Paras.SavingResult = DALObject.SaveNewRecord(SaveModel); base.SaveRecord(Paras); }
public override void SaveRecord(SavingParemeter Paras) { DAL.tblMinimumWageCategory SaveModel = null; if (Paras.SavingInterface == SavingParemeter.eSavingInterface.AddNew || EditRecordDataSource == null) { SaveModel = new DAL.tblMinimumWageCategory(); } else { SaveModel = DALObject.FindSaveModelByPrimeKey(((MinimumWageCategoryEditListModel)EditRecordDataSource).MinimumWageCategoryID); if (SaveModel == null) { Paras.SavingResult = new SavingResult(); Paras.SavingResult.ExecutionResult = eExecutionResult.ValidationError; Paras.SavingResult.ValidationError = "Can not edit. Selected record not found, it may be deleted by another user."; return; } } SaveModel.MinimumWageCategoryName = txtMinimumWageCategoryName.Text; SaveModel.ApplyOn = (byte)cmbApplyOn.SelectedIndex; Paras.SavingResult = DALObject.SaveNewRecord(SaveModel); base.SaveRecord(Paras); }
public override void SaveRecord(SavingParemeter Paras) { SelectedUser = UserDALObj.GetUserDetailModelByEmailID(txtUserName.Text, txtEMailID.Text); if (SelectedUser == null) { Paras.SavingResult = new SavingResult() { ExecutionResult = eExecutionResult.ValidationError, ValidationError = "Entered user name or email id is not found." }; return; } else { string NewPassword = Guid.NewGuid().ToString().Substring(0, 6); Paras.SavingResult = UserDALObj.ChangePassworD(SelectedUser.UserID, NewPassword); if (Paras.SavingResult.ExecutionResult == eExecutionResult.CommitedSucessfuly) { Model.CommonFunctions.SendEmailFromNoReply(SelectedUser.EMailID, "Password reset for Vision", $@"Your password has been reset to login in Vision : User Name : {SelectedUser.UserName} Password : { NewPassword} Please login into Vision and change your password."); } Paras.SavingResult.MessageAfterSave = "Your new password has been sent to email id " + SelectedUser.EMailID + "."; Paras.SavingResult.ExecutionResult = eExecutionResult.NotExecutedYet; } base.SaveRecord(Paras); }
public override void SaveRecord(SavingParemeter Paras) { DAL.tblEmployeeEarningDeduction SaveModel = null; if (Paras.SavingInterface == SavingParemeter.eSavingInterface.AddNew || EditRecordDataSource == null) { SaveModel = new DAL.tblEmployeeEarningDeduction(); } else { SaveModel = DALObject.FindSaveModelByPrimeKey(((EarningDeductionEditListModel)EditRecordDataSource).EmployeeEarningDeductionID); if (SaveModel == null) { Paras.SavingResult = new SavingResult(); Paras.SavingResult.ExecutionResult = eExecutionResult.ValidationError; Paras.SavingResult.ValidationError = "Can not edit. Selected record not found, it may be deleted by another user."; return; } } SaveModel.EmployeeEarningDeductionNo = (int)txtEarningDeductionNo.EditValue; SaveModel.EmployeeEarningDeductionName = txtEarningDeductionName.Text; SaveModel.EarningDeductionType = (byte)cmbEarningDeductionType.SelectedIndex; SaveModel.Taxable = (cmbTaxable.SelectedIndex == 1); SaveModel.Recurring = (cmbRecurring.SelectedIndex == 1); SaveModel.ValueType = (byte)cmbValueType.SelectedIndex; SaveModel.Remarks = txtRemarks.Text; Paras.SavingResult = DALObject.SaveNewRecord(SaveModel); base.SaveRecord(Paras); }
public override void AfterSaving(SavingParemeter Paras) { if (Paras.SavingResult.ExecutionResult == eExecutionResult.CommitedSucessfuly) { this.Close(); } base.AfterSaving(Paras); }
public override void AfterSaving(SavingParemeter Paras) { if (Paras.SavingResult.ExecutionResult == eExecutionResult.CommitedSucessfuly)//i need to set this result from data layer. { MessageBox.Show("New Payroll month was created successfully. Please login again.", "Logout", MessageBoxButtons.OK, MessageBoxIcon.Information); Vision.WinForm.Navigation.frmDashBoard.DashBoard.Logout(); } base.AfterSaving(Paras); }
public override void AfterSaving(SavingParemeter Paras) { if (SelectedUser != null) { this.Close(); } base.AfterSaving(Paras); }
public override void AfterSaving(SavingParemeter Paras) { if (Paras.SavingResult.ExecutionResult == eExecutionResult.CommitedSucessfuly) { Navigation.frmDashBoard.DashBoard.ApplySettingsOnMenus(); this.Close(); } base.AfterSaving(Paras); }
public override void AfterSaving(SavingParemeter Paras) { if (Paras.SavingResult.ExecutionResult == eExecutionResult.CommitedSucessfuly) { if (MessageBox.Show("Rate updated successfully. Do you want to exit ?", "Exit ?", MessageBoxButtons.YesNo, MessageBoxIcon.Question) == DialogResult.Yes) { this.Close(); } } base.AfterSaving(Paras); }
public override void AfterSaving(SavingParemeter Paras) { if (Paras.SavingResult.ExecutionResult == eExecutionResult.CommitedSucessfuly) { if (Alit.WinformControls.MessageBox.Show("Do you want to exit ?", MessageBoxButtons.YesNo, MessageBoxIcon.Question) == DialogResult.Yes) { this.Close(); } } base.AfterSaving(Paras); }
public override void AfterSaving(SavingParemeter Paras) { if (Paras.SavingResult != null && (Paras.SavingResult.ExecutionResult == eExecutionResult.CommitedSucessfuly || Paras.SavingResult.ExecutionResult == eExecutionResult.NotExecutedYet)) { this.Close(); } else { txtUserName.Focus(); } base.AfterSaving(Paras); }
public override void AfterSaving(SavingParemeter Paras) { //if (Paras.SavingResult != null && (Paras.SavingResult.ExecutionResult == eExecutionResult.CommitedSucessfuly || // Paras.SavingResult.ExecutionResult == eExecutionResult.NotExecutedYet)) //{ this.Close(); //} //else //{ // lookupCompany.Focus(); //} base.AfterSaving(Paras); }
private async void btnSave_ItemClick(object sender, DevExpress.XtraBars.ItemClickEventArgs e) { if (!ProcessValidationFormControls()) { if (FirstControl != null && FirstControl.CanFocus) { FirstControl.Focus(); } return; } if (!ValidateBeforeSave()) { // it's implementing class responsibiliy to set focus on appropriate control. return; } SavingParemeter savingParas = new SavingParemeter(); savingParas.SavingInterface = SavingParemeter.eSavingInterface.AddNew; // ShowWaitForm(); beiProgressbar.Visibility = DevExpress.XtraBars.BarItemVisibility.Always; ProgressBarSavingProcess.Stopped = false; //try //{ await Task.Run(() => SaveRecord(savingParas)); //} //catch (Exception ex) //{ // beiProgressbar.Visibility = DevExpress.XtraBars.BarItemVisibility.Never; // CloseWaitForm(); // throw ex; //} ProgressBarSavingProcess.Stopped = true; beiProgressbar.Visibility = DevExpress.XtraBars.BarItemVisibility.Never; CloseWaitForm(); // //-- AfterSaving(savingParas); //-- if (savingParas.SavingResult != null && savingParas.SavingResult.ExecutionResult == eExecutionResult.CommitedSucessfuly) { ResetFormView(); } FirstControl.Focus(); }
public override void SaveRecord(SavingParemeter Paras) { DAL.tblEmployeeSalaryIncrement SaveModel = null; int EmployeeID = (int)txtEmployee.EditValue; if (Paras.SavingInterface == SavingParemeter.eSavingInterface.AddNew || EditRecordDataSource == null) { SaveModel = new DAL.tblEmployeeSalaryIncrement(); } else { SaveModel = DALObj.FindSaveModelByPrimeKey(((EmployeeSalaryIncrementEditListModel)EditRecordDataSource).EmployeeSalaryIncrementID); if (SaveModel == null) { Paras.SavingResult = new SavingResult(); Paras.SavingResult.ExecutionResult = eExecutionResult.ValidationError; Paras.SavingResult.ValidationError = "Can not edit. Selected record not found, it may be deleted by another user."; return; } } if (Model.CommonFunctions.ParseDecimal(txtIncrementAmount.Text) > 0) { SaveModel.EmployeeID = EmployeeID; SaveModel.LastIncAmount = Model.CommonFunctions.ParseDecimal(txtLastIncAmount.Text) > 0 ? Model.CommonFunctions.ParseDecimal(txtLastIncAmount.Text) : (decimal?)null; SaveModel.LastIncDate = !string.IsNullOrEmpty(dtpLastIncDate.Text) ? dtpLastIncDate.DateTime : (DateTime?)null; SaveModel.EffectiveMonth = dtpEffectiveMonth.DateTime.Month; SaveModel.EffectiveYear = dtpEffectiveMonth.DateTime.Year; SaveModel.CurrentBasicSalary = Model.CommonFunctions.ParseDecimal(txtCurrentBasicSalary.Text); SaveModel.IncrementType = (int)cmbIncrementType.SelectedIndex; SaveModel.IncrementPercentage = (decimal)txtIncrementPercentage.EditValue; SaveModel.EmployeeSalaryIncrementNo = Convert.ToInt32(txtTransectionNo.Text); SaveModel.EmployeeSalaryIncrementDate = dtpTransectionDate.DateTime; SaveModel.IncrementAmount = Model.CommonFunctions.ParseDecimal(txtIncrementAmount.Text); SaveModel.NewBasicSalary = Model.CommonFunctions.ParseDecimal(txtNewBasicSalary.Text); SaveModel.Remarks = txtRemarks.Text; Paras.SavingResult = DALObj.SaveNewRecord(SaveModel); base.SaveRecord(Paras); } else { Paras.SavingResult = new SavingResult(); Paras.SavingResult.ExecutionResult = eExecutionResult.ValidationError; Paras.SavingResult.ValidationError = "Increment Amount should be greater then Zero."; return; } }
public override void SaveRecord(SavingParemeter Paras) { var User = UserDALObj.GetUserDetailModel(CommonProperties.LoginInfo.LoggedinUser.UserName, txtCurrentPassword.Text); if (User == null) { Paras.SavingResult = new SavingResult() { ExecutionResult = eExecutionResult.ValidationError, ValidationError = "Password is not correct." }; return; } Paras.SavingResult = UserDALObj.ChangePassworD(CommonProperties.LoginInfo.LoggedinUser.UserID, txtNewPassword.Text); base.SaveRecord(Paras); }
public override void SaveRecord(SavingParemeter Paras) { DAL.tblNonCashBenefit SaveModel = null; if (Paras.SavingInterface == SavingParemeter.eSavingInterface.AddNew || EditRecordDataSource == null) { SaveModel = new DAL.tblNonCashBenefit(); } else { SaveModel = DALObject.FindSaveModelByPrimeKey(((NonCashBenefitEditListModel)EditRecordDataSource).NonCashBenefitID); if (SaveModel == null) { Paras.SavingResult = new SavingResult(); Paras.SavingResult.ExecutionResult = eExecutionResult.ValidationError; Paras.SavingResult.ValidationError = "Can not edit. Selected record not found, it may be deleted by another user."; return; } } SaveModel.NonCashBenefitName = txtNonCashBenefitName.Text; SaveModel.NonCashBenefitType = (byte)cmbBenifitType.SelectedIndex; SaveModel.KRAValueType = (byte)cmbKRAValueType.SelectedIndex; SaveModel.KRAValue = (decimal)txtKRAValue.EditValue; SaveModel.CostValueType = (byte)cmbCostValueType.SelectedIndex; SaveModel.CostValue = (decimal)txtCostValue.EditValue; SaveModel.VehicleType = txtVehicleType.Text; SaveModel.VehicleRegistrationNo = txtRegistrationNo.Text; SaveModel.VehicleMake = txtMake.Text; SaveModel.VehicleModel = txtModelNo.Text; SaveModel.VehicleEnginePower = txtEnginePowerCC.Text; SaveModel.EngineCCKRAValue = (decimal)txtEngineCCKRAValue.EditValue; SaveModel.VehicleCostKRAPerc = (decimal)txtVehicleCostKRAPerc.EditValue; Paras.SavingResult = DALObject.SaveNewRecord(SaveModel); base.SaveRecord(Paras); }
public override void SaveRecord(SavingParemeter Paras) { DAL.tblLocation SaveModel = null; if (Paras.SavingInterface == SavingParemeter.eSavingInterface.AddNew || EditRecordDataSource == null) { SaveModel = new DAL.tblLocation(); } else { SaveModel = DALObject.FindSaveModelByPrimeKey(((LocationEditListModel)EditRecordDataSource).LocationID); if (SaveModel == null) { Paras.SavingResult = new SavingResult(); Paras.SavingResult.ExecutionResult = eExecutionResult.ValidationError; Paras.SavingResult.ValidationError = "Can not edit. Selected record not found, it may be deleted by another user."; return; } } SaveModel.LocationName = txtLocationName.Text; SaveModel.LocationTypeID = (byte)cmbLocationType.SelectedIndex; SaveModel.GracePeriod = Model.CommonFunctions.ParseInt(txtGracePeriod.Text); Paras.SavingResult = DALObject.SaveNewRecord(SaveModel, new LocationWeekendSettingViewModel() { WEDateFrom = (DateTime?)deWithEffectDate.EditValue, Monday = (eWeekDayType)cmbWeekendMonday.SelectedIndex, Tuesday = (eWeekDayType)cmbWeekendTuesday.SelectedIndex, Wednesday = (eWeekDayType)cmbWeekendWednesday.SelectedIndex, Thursday = (eWeekDayType)cmbWeekendThursday.SelectedIndex, Friday = (eWeekDayType)cmbWeekendFriday.SelectedIndex, Saturday = (eWeekDayType)cmbWeekendSaturday.SelectedIndex, Sunday = (eWeekDayType)cmbWeekendSunday.SelectedIndex, }); base.SaveRecord(Paras); }
public override void SaveRecord(SavingParemeter Paras) { int MonthFrom = DateFrom.Month; int YearFrom = DateFrom.Year; int EmployeeID = (int)lookupEmployee.EditValue; tblPayrollEmployeeDetail EmployeeDetailSaveModel = null; if (EditingEmployeeDetail != null && EditingEmployeeDetail.PayrollEmployeeDetailID != 0) { EmployeeDetailSaveModel = DALObj.FindPayrollEmployeeDetailByID(EditingEmployeeDetail.PayrollEmployeeDetailID); } if (EmployeeDetailSaveModel == null) { EmployeeDetailSaveModel = new tblPayrollEmployeeDetail(); } EmployeeDetailSaveModel.EmployeeID = EmployeeID; EmployeeDetailSaveModel.NormalOvertimeHours = NormalOvertimeHours; EmployeeDetailSaveModel.DoubleOvertimeHours = DoubleOvertimeHours; EmployeeDetailSaveModel.AbsentDays = AbsentDays; EmployeeDetailSaveModel.WeekendWorkedDays = WeekendWorkedDays; EmployeeDetailSaveModel.LeaveEncashmentDays = LeaveEncashmentDays; EmployeeDetailSaveModel.NoticePayDays = NoticePayDay; EmployeeDetailSaveModel.LateDays = LatenessDays; EmployeeDetailSaveModel.LoanInstallmentAmount = LoanInstallmentAmt; EmployeeDetailSaveModel.Vehicle_NoncashBenefitID = (int?)lookUpVehicle_NonCashBenefit.EditValue; if (EmployeeDetailSaveModel.Vehicle_NoncashBenefitID == -1) { EmployeeDetailSaveModel.Vehicle_NoncashBenefitID = null; } Paras.SavingResult = DALObj.SavePayroll(DateFrom.Month, DateFrom.Year, EmployeeDetailSaveModel, dsEarningAndDeduction, dsNonCashBenefit, dsPAYERelief); base.SaveRecord(Paras); }
public override void SaveRecord(SavingParemeter Paras) { DAL.tblEmployeeShift SaveModel = null; if (Paras.SavingInterface == SavingParemeter.eSavingInterface.AddNew || EditRecordDataSource == null) { SaveModel = new DAL.tblEmployeeShift(); } else { SaveModel = DALObject.FindSaveModelByPrimeKey(((EmployeeShiftEditListModel)EditRecordDataSource).EmployeeShiftID); if (SaveModel == null) { Paras.SavingResult = new SavingResult(); Paras.SavingResult.ExecutionResult = eExecutionResult.ValidationError; Paras.SavingResult.ValidationError = "Can not edit. Selected record not found, it may be deleted by another user."; return; } } SaveModel.EmployeeShiftName = txtEmployeeShiftName.Text; SaveModel.ShiftType = (byte)cmbShiftType.SelectedIndex; SaveModel.ShiftStartTime = deShiftStart.DateTime.TimeOfDay; SaveModel.ShiftEndTime = deShiftEnd.DateTime.TimeOfDay; SaveModel.FirstBreakStartTime = (deBreak1Start.EditValue != null ? (TimeSpan?)deBreak1Start.DateTime.TimeOfDay : null); SaveModel.FirstBreakEndTime = (deBreak1Start.EditValue != null ? (TimeSpan?)deBreak1End.DateTime.TimeOfDay : null); SaveModel.SecondBreakStartTime = (deBreak2Start.EditValue != null ? (TimeSpan?)deBreak2Start.DateTime.TimeOfDay : null); SaveModel.SecondBreakEndTime = (deBreak2End.EditValue != null ? (TimeSpan?)deBreak2End.DateTime.TimeOfDay : null); SaveModel.ThirdBreakStartTime = (deBreak3Start.EditValue != null ? (TimeSpan?)deBreak3Start.DateTime.TimeOfDay : null); SaveModel.ThirdBreakEndTime = (deBreak3End.EditValue != null ? (TimeSpan?)deBreak3End.DateTime.TimeOfDay : null); Paras.SavingResult = DALObject.SaveNewRecord(SaveModel); base.SaveRecord(Paras); }
public override void SaveRecord(Model.SavingParemeter Paras) { DialogResult result = MessageBox.Show("Are you sure? you want to close current payroll month?", "Close Payroll month", MessageBoxButtons.YesNo, MessageBoxIcon.Question); if (result == DialogResult.Yes) { tblPayrollMonth SaveModel = null; if (Paras.SavingInterface == SavingParemeter.eSavingInterface.AddNew) { SaveModel = new tblPayrollMonth(); } //SaveModel.tblCompany = SaveModel.CompanyID = CommonProperties.LoginInfo.LoggedInCompany.CompanyID; SaveModel.PayrollMonthName = txtNextMonthName.EditValue.ToString(); SaveModel.PayrollMonth = Convert.ToDateTime(txtNextMonthName.EditValue); SaveModel.PayrollMonthEndDate = Convert.ToDateTime(txtNextMonthEndDate.EditValue); SaveModel.PayrollMonthStartDate = Convert.ToDateTime(txtNextMonthStartDate.EditValue); //SaveModel.rcdt = DateTime.Now; //SaveModel.rcuid = CommonProperties.LoginInfo.LoggedinUser.UserID; SavingParemeter SaveResult = new SavingParemeter(); SaveResult.SavingResult = DALObject.SaveNewRecord(SaveModel); AfterSaving(SaveResult); } }
public override void UnAuthorize(SavingParemeter Paras) { Paras.SavingResult = DALObject.UnAuthorize(((CityEditListModel)EditRecordDataSource).CityID); }