Example #1
0
        public override void SaveRecord(SavingParemeter Paras)
        {
            DAL.tblEmployeeDesignation SaveModel = null;

            if (Paras.SavingInterface == SavingParemeter.eSavingInterface.AddNew || EditRecordDataSource == null)
            {
                SaveModel = new DAL.tblEmployeeDesignation();
            }
            else
            {
                SaveModel = DALObject.FindSaveModelByPrimeKey(((EmployeeDesignationEditListModel)EditRecordDataSource).EmployeeDesignationID);

                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.EmployeeDesignationName = txtEmployeeDesignationName.Text;
            //SaveModel.ISDCode = txtISDCode.Text;

            Paras.SavingResult = DALObject.SaveNewRecord(SaveModel);
            base.SaveRecord(Paras);
        }
Example #2
0
        public override void FillSelectedRecordInContent(object RecordToFill)
        {
            EmployeeDesignationEditListModel EditingRecord = (EmployeeDesignationEditListModel)RecordToFill;

            DAL.tblEmployeeDesignation SaveModel = DALObject.FindSaveModelByPrimeKey(EditingRecord.EmployeeDesignationID);

            if (SaveModel == null)
            {
                return;
            }

            txtEmployeeDesignationName.Text = SaveModel.EmployeeDesignationName;
        }