public Model.General.ReturnValueInfo Save(Model.IModel.IModelObject itemEntity, Common.DefineConstantValue.EditStateEnum EditMode)
 {
     ReturnValueInfo rvInfo = new ReturnValueInfo();
     try
     {
         BlacklistChangeRecord_blc_Info recordInfo = itemEntity as BlacklistChangeRecord_blc_Info;
         if (recordInfo == null)
         {
             rvInfo.isError = true;
             rvInfo.messageText = Common.DefineConstantValue.SystemMessageText.strMessageText_E_ObjectNull;
             return rvInfo;
         }
         switch (EditMode)
         {
             case Common.DefineConstantValue.EditStateEnum.OE_Insert:
                 return this._IBlacklistChangeRecordDA.InsertRecord(recordInfo);
                 break;
             case Common.DefineConstantValue.EditStateEnum.OE_Update:
                 return this._IBlacklistChangeRecordDA.UpdateRecord(recordInfo);
                 break;
             case Common.DefineConstantValue.EditStateEnum.OE_Delete:
                 return this._IBlacklistChangeRecordDA.DeleteRecord(recordInfo);
                 break;
             default:
                 break;
         }
     }
     catch (Exception ex)
     {
         rvInfo.messageText = ex.Message;
         rvInfo.isError = true;
     }
     return rvInfo;
 }
Esempio n. 2
0
        public Model.General.ReturnValueInfo Save(Model.IModel.IModelObject itemEntity, Common.DefineConstantValue.EditStateEnum EditMode)
        {
            ReturnValueInfo returnInfo = new ReturnValueInfo(false);

            ConsumeMachineMaster_cmm_Info objInfo = itemEntity as ConsumeMachineMaster_cmm_Info;

            try
            {
                switch (EditMode)
                {
                    case Common.DefineConstantValue.EditStateEnum.OE_Insert:
                        objInfo.cmm_dAddDate = DateTime.Now;
                        objInfo.cmm_dLastDate = DateTime.Now;
                        objInfo.cmm_dLastAccessTime = DateTime.Now;
                        objInfo.cmm_cRecordID = Guid.NewGuid();
                        returnInfo = _icmDA.InsertRecord(objInfo);
                        break;
                    case Common.DefineConstantValue.EditStateEnum.OE_Update:
                        objInfo.cmm_dLastDate = DateTime.Now;
                        returnInfo = _icmDA.UpdateRecord(objInfo);
                        break;
                }
            }
            catch
            {
                throw;
            }

            return returnInfo;
        }
Esempio n. 3
0
        public ReturnValueInfo Delete(SysMonitoring objInfo)
        {
            ReturnValueInfo returnInfo = new ReturnValueInfo(false);
            try
            {
                using (MainDBDataContext db = new MainDBDataContext())
                {
                    var delTab = db.SystemMonitoring_sym.Where(t => t.sym_MACAddress == objInfo.sym_MACAddress);
                    if (delTab != null)
                    {
                        foreach (var item in delTab)
                        {
                            db.SystemMonitoring_sym.DeleteOnSubmit(item);
                        }

                        db.SubmitChanges();
                        returnInfo.boolValue = true;
                    }
                }
            }
            catch (Exception Ex)
            {
                returnInfo.messageText = Ex.Message;
            }
            return returnInfo;
        }
Esempio n. 4
0
 public ReturnValueInfo Save(IModelObject itemEntity, Common.DefineConstantValue.EditStateEnum EditMode)
 {
     ReturnValueInfo rvInfo = new ReturnValueInfo();
     try
     {
         switch (EditMode)
         {
             case Common.DefineConstantValue.EditStateEnum.OE_Insert:
                 rvInfo = this._iDMDL.InsertRecord(itemEntity as DepartmentMaster_dpm_Info);
                 break;
             case Common.DefineConstantValue.EditStateEnum.OE_Update:
                 rvInfo = this._iDMDL.UpdateRecord(itemEntity as DepartmentMaster_dpm_Info);
                 break;
             case Common.DefineConstantValue.EditStateEnum.OE_Delete:
                 rvInfo = this._iDMDL.DeleteRecord(itemEntity);
                 break;
             case Common.DefineConstantValue.EditStateEnum.OE_ReaOnly:
                 break;
             default:
                 break;
         }
     }
     catch (Exception ex)
     {
         rvInfo.messageText = ex.Message;
         rvInfo.isError = true;
     }
     return rvInfo;
 }
Esempio n. 5
0
        public ReturnValueInfo DeleteRecord(IModelObject KeyObject)
        {
            ReturnValueInfo rvInfo = new ReturnValueInfo();
            DepartmentMaster_dpm_Info searchInfo = KeyObject as DepartmentMaster_dpm_Info;
            if (searchInfo == null)
            {
                rvInfo.messageText = Common.DefineConstantValue.SystemMessageText.strMessageText_E_ObjectNull;
                rvInfo.isError = true;
                return rvInfo;
            }
            try
            {
                using (SIOTSDB_HHZXDataContext db = new SIOTSDB_HHZXDataContext())
                {
                    List<DepartmentMaster_dpm> listDept = db.DepartmentMaster_dpm.Where(x => x.dpm_RecordID == searchInfo.dpm_RecordID).ToList();

                    if (listDept != null)
                    {
                        db.DepartmentMaster_dpm.DeleteAllOnSubmit(listDept);
                        db.SubmitChanges();
                        rvInfo.boolValue = true;
                    }
                }
            }
            catch (Exception ex)
            {
                rvInfo.messageText = ex.Message;
                rvInfo.isError = true;
            }
            return rvInfo;
        }
Esempio n. 6
0
        public ReturnValueInfo DeleteRecord(ProjectStopReason_pjsr_Info reasonInfo)
        {
            ReturnValueInfo returnInfo = new ReturnValueInfo(false);

            if (reasonInfo != null)
            {
                try
                {
                    using (MainDBDataContext db = new MainDBDataContext())
                    {
                        ProjectStopReason_pjsr deleteData = db.ProjectStopReason_pjsr.FirstOrDefault(t => t.pjsr_RecordID == reasonInfo.pjsr_RecordID);

                        if (deleteData != null)
                        {
                            db.ProjectStopReason_pjsr.DeleteOnSubmit(deleteData);

                            db.SubmitChanges();

                            returnInfo.boolValue = true;
                        }
                    }
                }
                catch (Exception Ex)
                {

                    returnInfo.messageText = Ex.Message;
                }
            }

            return returnInfo;
        }
Esempio n. 7
0
 public ReturnValueInfo Save(IModelObject itemEntity, Common.DefineConstantValue.EditStateEnum EditMode)
 {
     ReturnValueInfo rvInfo = new ReturnValueInfo();
     try
     {
         switch (EditMode)
         {
             case Common.DefineConstantValue.EditStateEnum.OE_Insert:
                 rvInfo = this._IPreRechargeRecordDA.InsertRecord(itemEntity as PreRechargeRecord_prr_Info);
                 break;
             case Common.DefineConstantValue.EditStateEnum.OE_Update:
                 rvInfo = this._IPreRechargeRecordDA.UpdateRecord(itemEntity as PreRechargeRecord_prr_Info);
                 break;
             case Common.DefineConstantValue.EditStateEnum.OE_Delete:
                 rvInfo = this._IPreRechargeRecordDA.DeleteRecord(itemEntity);
                 break;
             default:
                 break;
         }
     }
     catch (Exception ex)
     {
         rvInfo.isError = true;
         rvInfo.messageText = ex.Message;
     }
     return rvInfo;
 }
        public ReturnValueInfo DeleteRecord(IModelObject KeyObject)
        {
            ReturnValueInfo returnInfo = new ReturnValueInfo(false);

            PaymentUDMealState_pms_Info deleteInfo = KeyObject as PaymentUDMealState_pms_Info;

            if (deleteInfo != null)
            {
                try
                {
                    using (SIOTSDB_HHZXDataContext db = new SIOTSDB_HHZXDataContext())
                    {
                        PaymentUDMealState_pms deleteData = db.PaymentUDMealState_pms.FirstOrDefault(t => t.pms_cRecordID == deleteInfo.pms_cRecordID);

                        if (deleteData != null)
                        {
                            db.PaymentUDMealState_pms.DeleteOnSubmit(deleteData);

                            db.SubmitChanges();

                            returnInfo.boolValue = true;
                        }
                    }
                }
                catch (Exception Ex)
                {

                    returnInfo.messageText = Ex.Message;
                }
            }

            return returnInfo;
        }
Esempio n. 9
0
 public Model.General.ReturnValueInfo InsertRecord(Model.HHZX.ConsumerDevice.ConsumeMachineMaster_cmm_Info infoObject)
 {
     ReturnValueInfo rvInfo = new ReturnValueInfo();
     try
     {
         if (infoObject != null)
         {
             using (SIOTSDB_HHZXDataContext db = new SIOTSDB_HHZXDataContext())
             {
                 ConsumeMachineMaster_cmm record = Common.General.CopyObjectValue<ConsumeMachineMaster_cmm_Info, ConsumeMachineMaster_cmm>(infoObject);
                 if (record != null)
                 {
                     db.ConsumeMachineMaster_cmm.InsertOnSubmit(record);
                     db.SubmitChanges();
                     rvInfo.boolValue = true;
                     rvInfo.ValueObject = infoObject;
                 }
                 else
                 {
                     rvInfo.messageText = "TransEntity is null";
                 }
             }
         }
         else
         {
             rvInfo.messageText = Common.DefineConstantValue.SystemMessageText.strMessageText_E_ObjectNull;
         }
     }
     catch (Exception ex)
     {
         rvInfo.isError = true;
         rvInfo.messageText = ex.Message;
     }
     return rvInfo;
 }
Esempio n. 10
0
 void Login()
 {
     ILoginFormBL objILoginFormBL = BLL.Factory.SysMaster.MasterBLLFactory.GetBLL<ILoginFormBL>(BLL.Factory.SysMaster.MasterBLLFactory.LoginForm);
     ReturnValueInfo msg = new ReturnValueInfo();
     Sys_UserMaster_usm_Info userInfo = new Sys_UserMaster_usm_Info();
     userInfo.usm_cUserLoginID = txtUserName.Text;
     userInfo.usm_cPasswork = txtPwd.Text;
     try
     {
         msg = objILoginFormBL.Login(userInfo);
         if (msg.boolValue == true)
         {
             Session["UserInfo"] = userInfo;
             Response.Redirect("~/Main.aspx");
         }
         else
         {
             Session["UserInfo"] = null;
             txtPwd.Focus();
             txtPwd.Text = string.Empty;
             lblMsg.Text = msg.messageText.Trim();
         }
     }
     catch (Exception ex)
     {
         lblMsg.Text = "系統異常:" + getShortCutErrMsgDesc(ex);
     }
 }
Esempio n. 11
0
 public void ShowForm(ReturnValueInfo valueInfo)
 {
     //KeyBoard.OpenKeyBoard();
     _valueInfo = valueInfo;
     this.ShowDialog();
     tbxPwd.SelectAll();
     tbxPwd.Focus();
 }
Esempio n. 12
0
        public SysFormMaster()
        {
            InitializeComponent();

            _iRecordID = string.Empty;
            _msg = new ReturnValueInfo();
            _pCode = string.Empty;
            this._ISysFormMasterBL = MasterBLLFactory.GetBLL<ISysFormMasterBL>(MasterBLLFactory.SysFormMaster);
            this._ISysFunctionMasterBL = MasterBLLFactory.GetBLL<ISysFunctionMasterBL>(MasterBLLFactory.SysFunctionMaster);
        }
Esempio n. 13
0
        public ReturnValueInfo DeleteRecord(IModelObject KeyObject)
        {
            ReturnValueInfo returnInfo = new ReturnValueInfo(false);

            GradeMaster_gdm_Info deleteInfo = KeyObject as GradeMaster_gdm_Info;

            if (deleteInfo != null)
            {
                try
                {
                    using (SIOTSDB_HHZXDataContext db = new SIOTSDB_HHZXDataContext())
                    {
                        GradeMaster_gdm deleteData = db.GradeMaster_gdm.FirstOrDefault(t => t.gdm_cRecordID == deleteInfo.gdm_cRecordID);

                        if (deleteData != null)
                        {
                            IEnumerable<ClassMaster_csm> classe = from t in db.ClassMaster_csm
                                                                  where t.csm_cGDMID == deleteInfo.gdm_cRecordID
                                                                  select t;

                            if (classe != null && classe.Count() > 0)
                            {
                                returnInfo.messageText = Common.DefineConstantValue.SystemMessageText.strMessageText_E_DeleteObjectHaveContectData;
                            }
                            else
                            {
                                db.GradeMaster_gdm.DeleteOnSubmit(deleteData);

                                db.SubmitChanges();

                                returnInfo.boolValue = true;
                            }
                        }
                        else
                        {
                            returnInfo.messageText = Common.DefineConstantValue.SystemMessageText.strMessageText_E_DeleteDataNull;
                        }
                    }
                }
                catch (Exception Ex)
                {

                    returnInfo.messageText = Ex.Message;
                }
            }
            else
            {
                returnInfo.messageText = Common.DefineConstantValue.SystemMessageText.strMessageText_E_DeleteDataNull;
            }

            return returnInfo;
        }
Esempio n. 14
0
 public override ReturnValueInfo Conn()
 {
     ReturnValueInfo rvInfo = new ReturnValueInfo();
     try
     {
         rvInfo.boolValue = this._Reader.ER_OpenReader();
     }
     catch (Exception ex)
     {
         rvInfo.isError = true;
         rvInfo.messageText = ex.Message;
     }
     return rvInfo;
 }
Esempio n. 15
0
 public ReturnValueInfo AccountCashReFund(IModelObject infoObject, string strReason)
 {
     ReturnValueInfo rvInfo = new ReturnValueInfo();
     try
     {
         rvInfo = this._ICardUserAccountDA.AccountCashReFund(infoObject, strReason);
     }
     catch (Exception ex)
     {
         rvInfo.isError = true;
         rvInfo.messageText = ex.Message;
     }
     return rvInfo;
 }
Esempio n. 16
0
        public Model.General.ReturnValueInfo Save(Model.IModel.IModelObject itemEntity, Common.DefineConstantValue.EditStateEnum EditMode)
        {
            bool _check;

            Model.General.ReturnValueInfo msg  = new Model.General.ReturnValueInfo();
            DataRightsRole_drr_Info       info = null;

            info = itemEntity as DataRightsRole_drr_Info;
            if (info == null)
            {
                msg.boolValue   = false;
                msg.messageText = "传入的数据为空!";
                return(msg);
            }
            try
            {
                switch (EditMode)
                {
                case Common.DefineConstantValue.EditStateEnum.OE_Delete:
                    _check = this._dataRightsRoleDA.DeleteRecord(info);
                    if (_check)
                    {
                        msg.messageText = Common.DefineConstantValue.SystemMessageText.strMessageText_I_RecordByDelete;
                    }
                    break;

                case Common.DefineConstantValue.EditStateEnum.OE_Insert:

                    _check = this._dataRightsRoleDA.IsExistRecord(info);
                    if (!_check)
                    {
                        msg.boolValue = this._dataRightsRoleDA.InsertRecord(info);
                    }
                    else
                    {
                        msg.messageText = Common.DefineConstantValue.SystemMessageText.strMessageText_I_AddFail + "  表单编号重复!";
                    }
                    break;

                case Common.DefineConstantValue.EditStateEnum.OE_Update:
                    msg.boolValue = this._dataRightsRoleDA.UpdateRecord(info);
                    break;
                }
            }
            catch (Exception Ex)
            {
                throw Ex;
            }
            return(msg);
        }
Esempio n. 17
0
 public override Model.General.ReturnValueInfo DisConn()
 {
     ReturnValueInfo rvInfo = new ReturnValueInfo();
     try
     {
         rvInfo.boolValue = this._Reader.ER_CloseReader();
     }
     catch (Exception ex)
     {
         rvInfo.isError = true;
         rvInfo.messageText = ex.Message;
     }
     return rvInfo;
 }
Esempio n. 18
0
 public override ReturnValueInfo ModifySectionPwd(int iSectionNum, string strOldPwd, string strNewPwd)
 {
     ReturnValueInfo rvInfo = new ReturnValueInfo();
     try
     {
         rvInfo.boolValue = this._Reader.ER_WriteCardSectionPwd(iSectionNum, strOldPwd, strNewPwd);
     }
     catch (Exception ex)
     {
         rvInfo.isError = true;
         rvInfo.messageText = ex.Message;
     }
     return rvInfo;
 }
Esempio n. 19
0
 public ReturnValueInfo BatchSolveUncertainRecord(List<PreConsumeRecord_pcs_Info> listRecords, bool isSettled)
 {
     ReturnValueInfo rvInfo = new ReturnValueInfo();
     try
     {
         rvInfo = this._IPreConsumeRecordDA.BatchSolveUncertainRecord(listRecords, isSettled);
     }
     catch (Exception ex)
     {
         rvInfo.isError = true;
         rvInfo.messageText = ex.Message;
     }
     return rvInfo;
 }
Esempio n. 20
0
 public override ReturnValueInfo AddWhitelist(string strCardNo)
 {
     ReturnValueInfo rvInfo = new ReturnValueInfo();
     try
     {
         rvInfo.boolValue = this._Device.ER_SetSigleNameList(strCardNo, EastRiverDevice_base.ER_ListType.AttendanceWhiteList);
     }
     catch (Exception ex)
     {
         rvInfo.isError = true;
         rvInfo.messageText = ex.Message;
     }
     return rvInfo;
 }
        public ReturnValueInfo BatchDeleteRecords(PaymentUDGeneralSetting_pus_Info searchInfo)
        {
            ReturnValueInfo rvInfo = new ReturnValueInfo();

            try
            {
                using (SIOTSDB_HHZXDataContext db = new SIOTSDB_HHZXDataContext())
                {
                    List<PaymentUDGeneralSetting_pus> searchData = db.PaymentUDGeneralSetting_pus.Where(x => 1 == 1).ToList();
                    PaymentUDGeneralSetting_pus_Info query = searchInfo as PaymentUDGeneralSetting_pus_Info;

                    if (query != null)
                    {
                        if (query.pus_cCardUserID != null)
                        {
                            searchData = searchData.Where(t => t.pus_cCardUserID == query.pus_cCardUserID).ToList();
                        }
                        if (query.pus_cClassID != null)
                        {
                            searchData = searchData.Where(t => t.pus_cClassID == query.pus_cClassID).ToList();
                        }
                        if (query.pus_cGradeID != null)
                        {
                            searchData = searchData.Where(t => t.pus_cGradeID == query.pus_cGradeID).ToList();
                        }
                        if (query.pus_iWeek != null && query.pus_iWeek != -1)
                        {
                            searchData = searchData.Where(t => t.pus_iWeek == query.pus_iWeek).ToList();
                        }
                    }
                    else
                    {
                        rvInfo.messageText = Common.DefineConstantValue.SystemMessageText.strMessageText_E_ObjectNull;
                        return rvInfo;
                    }

                    db.PaymentUDGeneralSetting_pus.DeleteAllOnSubmit(searchData);
                    db.SubmitChanges();
                    rvInfo.boolValue = true;
                }
            }
            catch (Exception ex)
            {
                rvInfo.isError = true;
                rvInfo.messageText = ex.Message;
            }
            return rvInfo;
        }
Esempio n. 22
0
 public override ReturnValueInfo Conn(IPAddress IPAddr, int iPort, int iMacID)
 {
     ReturnValueInfo rvInfo = new ReturnValueInfo();
     try
     {
         rvInfo.boolValue = this._Device.ER_ConnNet(IPAddr.ToString().ToCharArray(), iPort, iMacID);
         base.MacNo = iMacID;
         base.IP = IPAddr;
     }
     catch (Exception ex)
     {
         rvInfo.isError = true;
         rvInfo.messageText = ex.Message;
     }
     return rvInfo;
 }
Esempio n. 23
0
        public ReturnValueInfo AdjustSequency(Guid recordID, int level)
        {
            ReturnValueInfo returnValue = new ReturnValueInfo();
            try
            {
                var selectItem = _prepareProjectMasterDA.DisplayRecord(new PrepareProjectMaster_ppm_Info() { ppm_RecordID = recordID }) as PrepareProjectMaster_ppm_Info;
                if (level > 0)
                {

                    DataBaseCommandInfo commandInfo = new DataBaseCommandInfo();
                    commandInfo.KeyInfoList.Add(new DataBaseCommandKeyInfo() { KeyValue = recordID.ToString() });
                    var prevItem = _prepareProjectMasterDA.GetRecord_Previous(commandInfo);

                    selectItem.ppm_iSeq = prevItem.ppm_iSeq;
                    _prepareProjectMasterDA.UpdateRecord(selectItem);

                    prevItem.ppm_iSeq = selectItem.ppm_iSeq + 1;
                    _prepareProjectMasterDA.UpdateRecord(prevItem);
                    returnValue.boolValue = true;

                }
                else if (level < 0)
                {
                    DataBaseCommandInfo commandInfo = new DataBaseCommandInfo();
                    commandInfo.KeyInfoList.Add(new DataBaseCommandKeyInfo() { KeyValue = recordID.ToString() });
                    var nextItem = _prepareProjectMasterDA.GetRecord_Next(commandInfo);

                    selectItem.ppm_iSeq = nextItem.ppm_iSeq;
                    _prepareProjectMasterDA.UpdateRecord(selectItem);

                    nextItem.ppm_iSeq = selectItem.ppm_iSeq - 1;
                    _prepareProjectMasterDA.UpdateRecord(nextItem);

                    returnValue.boolValue = true;
                }

            }
            catch (Exception ex)
            {
                returnValue.isError = true;
                returnValue.boolValue = false;
                returnValue.ValueObject = ex;
                returnValue.messageText = ex.Message;
            }
            return returnValue;
        }
Esempio n. 24
0
        public ReturnValueInfo Save(IModelObject itemEntity, Common.DefineConstantValue.EditStateEnum EditMode)
        {
            ReturnValueInfo returnInfo = new ReturnValueInfo(false);

            GradeMaster_gdm_Info objInfo = itemEntity as GradeMaster_gdm_Info;

            try
            {
                switch (EditMode)
                {
                    case Common.DefineConstantValue.EditStateEnum.OE_Insert:

                        objInfo.gdm_dAddDate = DateTime.Now;

                        objInfo.gdm_cLastDate = DateTime.Now;

                        returnInfo = this._gradeMasterDA.InsertRecord(objInfo);

                        break;

                    case Common.DefineConstantValue.EditStateEnum.OE_Update:

                        objInfo.gdm_cLastDate = DateTime.Now;

                        returnInfo = this._gradeMasterDA.UpdateRecord(objInfo);

                        break;

                    case Common.DefineConstantValue.EditStateEnum.OE_Delete:

                        returnInfo = this._gradeMasterDA.DeleteRecord(objInfo);

                        break;

                    default:
                        break;
                }
            }
            catch (Exception Ex)
            {

                throw Ex;
            }

            return returnInfo;
        }
Esempio n. 25
0
 public ReturnValueInfo CheckGroupSignalStatusNotExists(IModelObject itemEntity, Guid parentId)
 {
     ReturnValueInfo returnInfo = new ReturnValueInfo(false);
     if (itemEntity is SignalLightsStatus_sls_Info)
     {
         SignalLightsStatus_sls_Info status = (SignalLightsStatus_sls_Info)itemEntity;
         try
         {
             returnInfo.boolValue = ((SignalLightsStatusDA)this._signalLightsStatusDA).CheckGroupSignalStatus(status, parentId);
         }
         catch (Exception Ex)
         {
             throw Ex;
         }
     }
     return returnInfo;
 }
        public ReturnValueInfo Save(IModelObject itemEntity, Common.DefineConstantValue.EditStateEnum EditMode)
        {
            ReturnValueInfo returnInfo = new ReturnValueInfo(false);

            if (itemEntity != null)
            {
                ShiftTargetYieldSchedule_sty_Info objInfo = itemEntity as ShiftTargetYieldSchedule_sty_Info;

                try
                {
                    switch (EditMode)
                    {
                        case Common.DefineConstantValue.EditStateEnum.OE_Insert:

                            objInfo.sty_dAddDate = DateTime.Now;

                            returnInfo.boolValue = this._shiftTargetYieldScheduleDA.InsertRecord(objInfo);

                            break;
                        case Common.DefineConstantValue.EditStateEnum.OE_Update:

                            objInfo.sty_dLastDate = DateTime.Now;

                            returnInfo.boolValue = this._shiftTargetYieldScheduleDA.UpdateRecord(objInfo);

                            break;
                        case Common.DefineConstantValue.EditStateEnum.OE_Delete:

                            returnInfo.boolValue = this._shiftTargetYieldScheduleDA.DeleteRecord(objInfo);

                            break;
                        case Common.DefineConstantValue.EditStateEnum.OE_ReaOnly:
                            break;
                        default:
                            break;
                    }
                }
                catch (Exception Ex)
                {

                    throw Ex;
                }
            }

            return returnInfo;
        }
Esempio n. 27
0
        public ReturnValueInfo Save(IModelObject itemEntity, Common.DefineConstantValue.EditStateEnum EditMode)
        {
            ReturnValueInfo returnInfo = new ReturnValueInfo(false);

            PayRecord_prd_Info objInfo = itemEntity as PayRecord_prd_Info;

            objInfo.prd_dAddDate = DateTime.Now;

            objInfo.prd_dLastDate = DateTime.Now;

            try
            {
                switch (EditMode)
                {
                    case Common.DefineConstantValue.EditStateEnum.OE_Insert:

                        objInfo.prd_cRecordID = Guid.NewGuid();

                        returnInfo = this._payRecordDA.InsertRecord(objInfo);

                        break;
                    case Common.DefineConstantValue.EditStateEnum.OE_Update:

                        returnInfo = this._payRecordDA.UpdateRecord(objInfo);

                        break;
                    case Common.DefineConstantValue.EditStateEnum.OE_Delete:

                        returnInfo = this._payRecordDA.DeleteRecord(objInfo);

                        break;
                    case Common.DefineConstantValue.EditStateEnum.OE_ReaOnly:
                        break;
                    default:
                        break;
                }
            }
            catch (Exception Ex)
            {

                throw Ex;
            }

            return returnInfo;
        }
Esempio n. 28
0
        public ReturnValueInfo DeleteRecord_Sqlite(Guid iRecordID)
        {
            ProjectStopRecord_psrd_Info recordInfo = SearchRecord_Sqlite(iRecordID);

            using (DBContext uow = DBContext.Begin())
            {
                try
                {

                    ReturnValueInfo rvInfo = new ReturnValueInfo();
                    ReturnValueInfo rvInfoRecord = new ReturnValueInfo();

                    if (recordInfo.StopReasonList != null)
                    {
                        foreach (ProjectStopReason_pjsr_Info reasonItem in recordInfo.StopReasonList)
                        {
                            uow.CurrentSession.Delete(recordInfo);

                            //ReturnValueInfo rvInfoReason = this._IProjectStopReasonDA_Sqlite.Delete(reasonItem);
                            //if (!rvInfoReason.boolValue || rvInfoReason.isError)
                            //{
                            //    return rvInfoReason;
                            //}
                        }
                    }

                    //rvInfoRecord = this._IProjectStopRecordDA_Sqlite.Delete(recordInfo);
                    //if (!rvInfoRecord.boolValue || rvInfoRecord.isError)
                    //{
                    //    return rvInfoRecord;
                    //}
                    uow.CurrentSession.Delete(recordInfo);

                    rvInfo.boolValue = true;

                    return rvInfo;
                }
                catch (Exception ex)
                {

                    throw ex;
                }
            }
        }
Esempio n. 29
0
        public ReturnValueInfo BatchInsertRecord(List<SourceConsumeRecord_scr_Info> listSrouce)
        {
            try
            {
                ReturnValueInfo rvInfo = new ReturnValueInfo();
                if (listSrouce == null)
                {
                    rvInfo.messageText = Common.DefineConstantValue.SystemMessageText.strMessageText_E_ObjectNull;
                    rvInfo.isError = true;
                    return rvInfo;
                }
                rvInfo = this._ISourceConsumeRecordDA.BatchInsertRecord(listSrouce);
                return rvInfo;
            }
            catch (Exception ex)
            {

                throw ex;
            }
        }
Esempio n. 30
0
        public ReturnValueInfo InsertRecord_Sqlite(ProjectMaterialReg_pmr_Info reasonInfo)
        {
            using (DBContext uow = DBContext.Begin())
            {
                try
                {

                    ReturnValueInfo rvInfo = new ReturnValueInfo();

                    object objRecord = uow.CurrentSession.Save(reasonInfo);

                    rvInfo.boolValue = true;

                    return rvInfo;
                }
                catch (Exception ex)
                {

                    throw ex;
                }
            }
        }
        public ReturnValueInfo DeleteRecord(IModelObject KeyObject)
        {
            ReturnValueInfo rvInfo = new ReturnValueInfo();
            try
            {
                CardUserAccountDetail_cuad_Info infoObject = KeyObject as CardUserAccountDetail_cuad_Info;
                if (infoObject != null)
                {
                    using (SIOTSDB_HHZXDataContext db = new SIOTSDB_HHZXDataContext())
                    {
                        CardUserAccountDetail_cuad record = db.CardUserAccountDetail_cuad.Where(x => x.cuad_cRecordID == infoObject.cuad_cRecordID).FirstOrDefault();

                        if (record != null)
                        {
                            db.CardUserAccountDetail_cuad.DeleteOnSubmit(record);

                            db.SubmitChanges();
                            rvInfo.boolValue = true;
                            rvInfo.ValueObject = infoObject;
                        }
                        else
                        {
                            rvInfo.messageText = "GetEntity is null";
                        }
                    }
                }
                else
                {
                    rvInfo.messageText = Common.DefineConstantValue.SystemMessageText.strMessageText_E_ObjectNull;
                }
            }
            catch (Exception ex)
            {
                rvInfo.isError = true;
                rvInfo.messageText = ex.Message;
            }
            return rvInfo;
        }
Esempio n. 32
0
        public Model.General.ReturnValueInfo DeleteData(DeleteDataLogic_ddl_Info info)
        {
            Model.General.ReturnValueInfo returnValue = new Model.General.ReturnValueInfo();
            switch (info.ddl_TableName)
            {
            case Common.DefineConstantValue.MasterType.SchoolMaster:
                break;

            case Common.DefineConstantValue.MasterType.SpecialtyMaster:
                break;

            case Common.DefineConstantValue.MasterType.BuildingMaster:
                break;

            case Common.DefineConstantValue.MasterType.DepartmentMaster:
                break;

            case Common.DefineConstantValue.MasterType.SiteMaster:
                break;

            case Common.DefineConstantValue.MasterType.CourseMaster:
                break;

            case Common.DefineConstantValue.MasterType.WinFormSkin:
                break;

            case Common.DefineConstantValue.MasterType.CodeMaster_Key1:
                break;

            case Common.DefineConstantValue.MasterType.CodeMaster_Key2:
                break;

            default:
                break;
            }

            return(returnValue);
        }