当前位置: 首页>>代码示例>>C#>>正文


C# MainDBDataContext.SubmitChanges方法代码示例

本文整理汇总了C#中LinqToSQLModel.MainDBDataContext.SubmitChanges方法的典型用法代码示例。如果您正苦于以下问题:C# MainDBDataContext.SubmitChanges方法的具体用法?C# MainDBDataContext.SubmitChanges怎么用?C# MainDBDataContext.SubmitChanges使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在LinqToSQLModel.MainDBDataContext的用法示例。


在下文中一共展示了MainDBDataContext.SubmitChanges方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: DeleteRecord

        public ReturnValueInfo DeleteRecord(Guid ntoID)
        {
            List<NoticeToMachine> listReturn = new List<NoticeToMachine>();
            try
            {
                using (MainDBDataContext db = new MainDBDataContext())
                {
                    var ret_notm = from notm in db.NoticeMachine_notm where notm.notm_NOTID == ntoID select notm;

                    if (ret_notm.Count() > 0)
                    {
                        db.NoticeMachine_notm.DeleteAllOnSubmit(ret_notm);
                        db.SubmitChanges();
                    }

                    DeleteNoticeList(ntoID);

                    var ret_not = from not in db.NoticeManage_not where not.not_RecordID == ntoID select not;

                    if (ret_not.Count() > 0)
                    {
                        db.NoticeManage_not.DeleteAllOnSubmit(ret_not);
                        db.SubmitChanges();
                    }

                }
            }
            catch (Exception Ex)
            {
                throw Ex;
            }
            return null;
        }
开发者ID:Klutzdon,项目名称:PBIMSN,代码行数:33,代码来源:NoticeManageDA.cs

示例2: DeleteRecord

        public bool DeleteRecord(IModelObject KeyObject)
        {
            bool isSuccess = false;

            if (KeyObject != null)
            {
                MailConfig_mcf_Info deleteInfo = KeyObject as MailConfig_mcf_Info;

                try
                {
                    using (MainDBDataContext db = new MainDBDataContext())
                    {
                        MailConfig_mcf deleteData = db.MailConfig_mcf.FirstOrDefault(t => t.mcf_iRecordID == deleteInfo.mcf_iRecordID);

                        db.MailConfig_mcf.DeleteOnSubmit(deleteData);

                        db.SubmitChanges();

                        isSuccess = true;
                    }
                }
                catch (Exception Ex)
                {

                    throw Ex;
                }
            }

            return isSuccess;
        }
开发者ID:Klutzdon,项目名称:PBIMSN,代码行数:30,代码来源:MailConfigDA.cs

示例3: DeleteRecord

        public bool DeleteRecord(Model.IModel.IModelObject KeyObject)
        {
            bool isSuccess = false;
            VacationMaster_vcm_Info delInfo = KeyObject as VacationMaster_vcm_Info;
            try
            {
                using (MainDBDataContext db = new MainDBDataContext())
                {
                    VacationMaster_vcm delTab = db.VacationMaster_vcm.SingleOrDefault(t => t.vcm_RecordID == delInfo.vcm_RecordID );
                    if (delTab != null)
                    {
                        //delTab.vcm_lIsDeleted = true;

                        db.VacationMaster_vcm.DeleteOnSubmit(delTab);
                        //delTab.vcm_lIsAtive = false;

                        db.SubmitChanges();
                        isSuccess = true;
                    }
                }

            }
            catch(Exception Ex)
            {
                throw Ex;
            }
            return isSuccess;
        }
开发者ID:Klutzdon,项目名称:PBIMSN,代码行数:28,代码来源:VacationMasterDA.cs

示例4: DeleteListByMachie

        public bool DeleteListByMachie(string MachineID)
        {
            bool isSuccess = false;

            try
            {
                using (MainDBDataContext db = new MainDBDataContext())
                {

                    List<MachineStopReasonProfile_msrp> uItems = db.MachineStopReasonProfile_msrp.Where(w => w.msrp_cMachineID.ToUpper().Trim() == MachineID.ToUpper().Trim()).ToList();

                    if (uItems != null)
                    {

                        db.MachineStopReasonProfile_msrp.DeleteAllOnSubmit(uItems);

                    }
                    db.SubmitChanges();
                    isSuccess = true;
                }
            }
            catch (Exception Ex)
            {
                throw Ex;
            }
            return isSuccess;
        }
开发者ID:Klutzdon,项目名称:PBIMSN,代码行数:27,代码来源:MachineStopReasonProfileDA.cs

示例5: DeleteList

        public bool DeleteList(List<MachineStopReasonProfile_msrp_Info> DeleteList)
        {
            //throw new NotImplementedException();

            bool isSuccess = false;

            try
            {
                using (MainDBDataContext db = new MainDBDataContext())
                {

                   // List<MachineStopReasonProfile_msrp> uItems = db.MachineStopReasonProfile_msrp.Where(w => w.msrp_iSRPFID == ReasonID).ToList();

                    if (DeleteList != null)
                    {
                        foreach (MachineStopReasonProfile_msrp_Info item in DeleteList)
                        {
                            //item.mpit_lIsDeleted = true;
                            //item.mpit_dUpdateTime = DateTime.Now;
                            MachineStopReasonProfile_msrp delitem = db.MachineStopReasonProfile_msrp.SingleOrDefault(w => w.msrp_iMSRPID  == item.msrp_iMSRPID );

                            db.MachineStopReasonProfile_msrp.DeleteOnSubmit(delitem);
                        }

                    }
                    db.SubmitChanges();
                    isSuccess = true;
                }
            }
            catch (Exception Ex)
            {
                throw Ex;
            }
            return isSuccess;
        }
开发者ID:Klutzdon,项目名称:PBIMSN,代码行数:35,代码来源:MachineStopReasonProfileDA.cs

示例6: Delete

        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;
        }
开发者ID:Klutzdon,项目名称:PBIMSN,代码行数:26,代码来源:SysMonitoringDA.cs

示例7: DeleteRecord

 public bool DeleteRecord(Model.IModel.IModelObject KeyObject)
 {
     bool isSuccess = false;
     AheadOfOffDuty_aod_Info info = new AheadOfOffDuty_aod_Info();
     info = KeyObject as AheadOfOffDuty_aod_Info;
     try
     {
         using (MainDBDataContext db = new MainDBDataContext())
         {
             //AheadOfOffDuty_aod delTab = db.AheadOfOffDuty_aod.SingleOrDefault(t => t.aod_iRecordID == info.aod_iRecordID && t.aod_lIsDeleted == false);
             AheadOfOffDuty_aod delTab = db.AheadOfOffDuty_aod.SingleOrDefault(t => t.aod_RecordID == info.aod_RecordID && t.aod_lIsAtive == true);
             if (delTab != null)
             {
                 //delTab.aod_lIsDeleted = true;
                 db.AheadOfOffDuty_aod.DeleteOnSubmit(delTab);
                 delTab.aod_lIsAtive = false;
                 db.SubmitChanges();
                 isSuccess = true;
             }
         }
     }
     catch (Exception Ex)
     {
         throw Ex;
     }
     return isSuccess;
 }
开发者ID:Klutzdon,项目名称:PBIMSN,代码行数:27,代码来源:AheadOfOffDutyDA.cs

示例8: DeleteRecord

        public bool DeleteRecord(Model.IModel.IModelObject KeyObject)
        {
            Sys_FunctionMaster_fum_Info info = null;
            try
            {
                info = KeyObject as Sys_FunctionMaster_fum_Info;
                using (MainDBDataContext db = new MainDBDataContext())
                {
                    Sys_FunctionMaster_fum fum = db.Sys_FunctionMaster_fum.Single<Sys_FunctionMaster_fum>(i => i.fum_iRecordID == info.fum_iRecordID);

                    for (int i = 0; i < fum.Sys_FormPurview_frp.Count; i++)
                    {
                        Sys_FormPurview_frp sta = fum.Sys_FormPurview_frp[i];
                        db.Sys_FormPurview_frp.DeleteOnSubmit(sta);
                    }

                    db.Sys_FunctionMaster_fum.DeleteOnSubmit(fum);
                    db.SubmitChanges();
                    return true;
                }
            }
            catch (Exception Ex)
            {
                throw Ex;
            }
        }
开发者ID:Klutzdon,项目名称:PBIMSN,代码行数:26,代码来源:SysFunctionMasterDA.cs

示例9: AddInArea

        public bool AddInArea(AreaMaster_amr_Info objArea, List<MachineMaster_mmt_Info> machines)
        {
            bool isSuccess = false;

            if (objArea != null && machines != null)
            {
                try
                {
                    using (MainDBDataContext db = new MainDBDataContext())
                    {
                        foreach (MachineMaster_mmt_Info item in machines)
                        {
                            MachineMaster_mmt updateData = db.MachineMaster_mmt.FirstOrDefault(t => t.mmt_cMachineID == item.mmt_cMachineID);

                            if (updateData != null)
                            {
                                updateData.mmt_cAreaID = objArea.amr_cRecordID;
                            }
                        }

                        db.SubmitChanges();

                        isSuccess = true;
                    }
                }
                catch (Exception Ex)
                {

                    throw Ex;
                }
            }

            return isSuccess;
        }
开发者ID:Klutzdon,项目名称:PBIMSN,代码行数:34,代码来源:AreaMasterDA.cs

示例10: DeleteRecord

 public bool DeleteRecord(Model.IModel.IModelObject KeyObject)
 {
     bool isSuccess = false;
     DinnerScheduleMaster_dsm_Info info = new DinnerScheduleMaster_dsm_Info();
     info = KeyObject as DinnerScheduleMaster_dsm_Info;
     try
     {
         using (MainDBDataContext db = new MainDBDataContext())
         {
             DinnerScheduleMaster_dsm delTab = db.DinnerScheduleMaster_dsm.SingleOrDefault(t => t.dsm_RecordID == info.dsm_RecordID);
             if (delTab != null)
             {
                 db.DinnerScheduleMaster_dsm.DeleteOnSubmit(delTab);
                 db.SubmitChanges();
                 isSuccess = true;
             }
         }
     }
     catch (Exception ex)
     {
         mLoger.Error("run DinnerScheduleMasterDA.DeleteRecord", ex);
         throw ex;
     }
     return isSuccess;
 }
开发者ID:Klutzdon,项目名称:PBIMSN,代码行数:25,代码来源:DinnerScheduleMasterDA.cs

示例11: DeleteRecord

        public bool DeleteRecord(IModelObject KeyObject)
        {
            bool isSuccess = false;

            if (KeyObject != null)
            {
                ShiftTargetYieldSchedule_sty_Info deleteInfo = KeyObject as ShiftTargetYieldSchedule_sty_Info;

                try
                {
                    using (MainDBDataContext db = new MainDBDataContext())
                    {
                        ShiftTargetYieldSchedule_sty deleteData = db.ShiftTargetYieldSchedule_sty.FirstOrDefault(t => t.sty_iRecordID == deleteInfo.sty_iRecordID);

                        if (deleteData != null)
                        {
                            //deleteData.sty_lIsDeleted = true;
                            deleteData.sty_lIsAtive = false;

                            db.SubmitChanges();

                            isSuccess = true;
                        }
                    }
                }
                catch (Exception Ex)
                {

                    throw Ex;
                }
            }

            return isSuccess;
        }
开发者ID:Klutzdon,项目名称:PBIMSN,代码行数:34,代码来源:ShiftTargetYieldScheduleDA.cs

示例12: DeleteRecord

        public bool DeleteRecord(Model.IModel.IModelObject KeyObject)
        {
            bool isSuccess = false;
            Model.HBPMS.Master.StaffInfoMaster_sim_Info info = new Model.HBPMS.Master.StaffInfoMaster_sim_Info();
            info = KeyObject as Model.HBPMS.Master.StaffInfoMaster_sim_Info;
            try
            {
                using (MainDBDataContext db = new MainDBDataContext())
                {

                    LinqToSQLModel.StaffInfoMaster_sim delTab = db.StaffInfoMaster_sim.SingleOrDefault(t => t.sim_iRecordID == info.sim_iRecordID);
                    if (delTab != null)
                    {
                        db.StaffInfoMaster_sim.DeleteOnSubmit(delTab);
                        db.SubmitChanges();
                        isSuccess = true;
                    }
                }
            }
            catch (Exception Ex)
            {
                throw Ex;
            }
            return isSuccess;
        }
开发者ID:Klutzdon,项目名称:PBIMSN,代码行数:25,代码来源:StaffInfoMasterDA.cs

示例13: DeleteRecord

        public bool DeleteRecord(IModelObject KeyObject)
        {
            bool isSuccess = false;
            MixMaterialDetail_mmdl_Info info = new MixMaterialDetail_mmdl_Info();
            info = KeyObject as MixMaterialDetail_mmdl_Info;

            using (MainDBDataContext db = new MainDBDataContext())
            {
                MixMaterialDetail_mmdl delTab = null;
                if (info.mmdl_Id != new Guid())
                {
                    delTab = db.MixMaterialDetail_mmdl.SingleOrDefault(t => t.mmdl_Id == info.mmdl_Id);
                    if (delTab != null)
                    {
                        db.MixMaterialDetail_mmdl.DeleteOnSubmit(delTab);
                    }
                }
                else
                {
                    var del = db.MixMaterialDetail_mmdl.Where(t =>
                        (info.mmdl_cMaterialCode != null ? t.mmdl_cMaterialCode == info.mmdl_cMaterialCode : true)
                        && (info.mmdl_cMaterialGroupNo != null ? t.mmdl_cMaterialGroupNo == info.mmdl_cMaterialGroupNo : true)
                        );
                    db.MixMaterialDetail_mmdl.DeleteAllOnSubmit(del);
                }
                //if (info.mmdl_cMaterialGroupNo != null)
                //{
                //    var del = db.MixMaterialDetail_mmdl.Where(c => c.mmdl_cMaterialGroupNo == info.mmdl_cMaterialGroupNo);
                //    db.MixMaterialDetail_mmdl.DeleteAllOnSubmit(del);
                //}
                db.SubmitChanges();
                isSuccess = true;
            }
            return isSuccess;
        }
开发者ID:Klutzdon,项目名称:PBIMSN,代码行数:35,代码来源:MixMaterialDetailDA.cs

示例14: DeleteRecord

        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;
        }
开发者ID:Klutzdon,项目名称:PBIMSN,代码行数:31,代码来源:ProjectStopReasonDA.cs

示例15: DeleteListByMachie

        public bool DeleteListByMachie(string MachineID)
        {
            bool isSuccess = false;

            try
            {
                using (MainDBDataContext db = new MainDBDataContext())
                {

                    List<MachinePrepareItem_mpit> uItems = db.MachinePrepareItem_mpit.Where(w => w.mpit_cDCMPID.ToUpper().Trim() == MachineID.ToUpper().Trim()).ToList();

                    if (uItems != null)
                    {
                        foreach (MachinePrepareItem_mpit item in uItems)
                        {
                            //item.mpit_lIsDeleted = true;
                            //item.mpit_dUpdateTime = DateTime.Now;
                            db.MachinePrepareItem_mpit.DeleteOnSubmit(item);
                        }

                    }
                    db.SubmitChanges();
                    isSuccess = true;
                }
            }
            catch (Exception Ex)
            {
                throw Ex;
            }
            return isSuccess;
        }
开发者ID:Klutzdon,项目名称:PBIMSN,代码行数:31,代码来源:MachineReadyPlanDA.cs


注:本文中的LinqToSQLModel.MainDBDataContext.SubmitChanges方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。