Exemple #1
0
        public override void SaveRecord(Model.SavingParemeter Paras)
        {
            DAL.tblUser SaveModel = null;
            if (Paras.SavingInterface == SavingParemeter.eSavingInterface.AddNew)
            {
                SaveModel = new DAL.tblUser();
            }
            else
            {
                SaveModel = DALObject.FindSaveModelByPrimeKey(((UserEditListModel)EditRecordDataSource).UserID);

                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.UserName    = txtUserName.Text;
            SaveModel.Password    = txtPassword.Text;
            SaveModel.UserGroupID = (int)lookUpUserGroup.EditValue;
            SaveModel.EMailID     = txtEmailID.Text;

            Paras.SavingResult = DALObject.SaveNewRecord(SaveModel);
            base.SaveRecord(Paras);
        }
Exemple #2
0
        public override void FillSelectedRecordInContent(object RecordToFill)
        {
            DAL.tblUser EditingRecord = DALObject.FindSaveModelByPrimeKey(((UserEditListModel)RecordToFill).UserID);

            txtUserName.Text          = EditingRecord.UserName;
            txtPassword.Text          = EditingRecord.Password;
            lookUpUserGroup.EditValue = EditingRecord.UserGroupID;
            txtEmailID.Text           = EditingRecord.EMailID;
        }