• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

C# LinqToSQLModel.MainDBDataContext类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

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



MainDBDataContext类属于LinqToSQLModel命名空间,在下文中一共展示了MainDBDataContext类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C#代码示例。

示例1: GetAllRecords

        public List<SysMonitoring> GetAllRecords()
        {
            try
            {
                using (MainDBDataContext db = new MainDBDataContext())
                {
                    return (from Sysm in db.SystemMonitoring_sym
                            select new SysMonitoring
                                {
                                    sym_MACAddress = Sysm.sym_MACAddress,
                                    sym_iSystemID = Sysm.sym_iSystemID,
                                    sym_cSystemType = Sysm.sym_cSystemType,
                                    sym_cSystemName = Sysm.sym_cSystemName,
                                    sym_cSystemIP = Sysm.sym_cSystemIP,
                                    sym_dStartTime = Sysm.sym_dStartTime,
                                    sym_iStatus = Sysm.sym_iStatus,
                                    sym_dUpdateTime = Sysm.sym_dUpdateTime,
                                    sym_cVersion = Sysm.sym_cVersion,
                                    sym_cProcessName = Sysm.sym_cProcessName,
                                    sym_lIsPLCConnection = Sysm.sym_lIsPLCConnection,
                                    sym_dMarkTime = Sysm.sym_dMarkTime,
                                    sym_dAddTime = Sysm.sym_dAddTime,
                                    sym_dLastTime = Sysm.sym_dLastTime,
                                    sym_cMachineID = Sysm.sym_cMachineID,
                                    sym_cSoftwareNo = Sysm.sym_cSoftwareNo
                                }).ToList();
                }
            }
            catch
            {

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


示例2: 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


示例3: 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


示例4: 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


示例5: 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


示例6: 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


示例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 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


示例9: 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


示例10: 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


示例11: 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


示例12: CboShiftType

 public List<ShiftTypeMaster_stm_Info> CboShiftType()
 {
     //Add by peizhiwu
     List<ShiftTypeMaster_stm_Info> list = new List<ShiftTypeMaster_stm_Info>();
     string strSQL = string.Empty;
     strSQL = " SELECT stm_iRecordID,stm_cShiftName,stm_cBeginTime,stm_cEndTime,stm_lIsAtive,stm_cAdd,stm_dAddDate,stm_cLast,stm_dLastDate " + Environment.NewLine;
     strSQL += " FROM ShiftTypeMaster_stm WHERE stm_lIsAtive = 1 " + Environment.NewLine;
     IEnumerable<ShiftTypeMaster_stm_Info> infos = null;
     try
     {
         using (MainDBDataContext db = new MainDBDataContext())
         {
             infos = db.ExecuteQuery<ShiftTypeMaster_stm_Info>(strSQL, new object[] { });
             if (infos != null)
             {
                 list = infos.ToList<ShiftTypeMaster_stm_Info>();
             }
         }
     }
     catch (Exception Ex)
     {
         throw Ex;
     }
     return list;
 }
开发者ID:Klutzdon,项目名称:PBIMSN,代码行数:25,代码来源:ShiftTypeMasterDA.cs


示例13: GetRecord_First

        public Sys_RoleMaster_rlm_Info GetRecord_First()
        {
            try
            {

                using (MainDBDataContext db = new MainDBDataContext())
                {
                    IQueryable<Sys_RoleMaster_rlm> taQuery =
                        (from ta in db.Sys_RoleMaster_rlm
                         orderby ta.rlm_iRecordID ascending
                         select ta).Take(1);
                    Sys_RoleMaster_rlm_Info info = new Sys_RoleMaster_rlm_Info();
                    if (taQuery.Count() > 0)
                    {
                        foreach (var t in taQuery)
                        {
                            info = Common.General.CopyObjectValue<Sys_RoleMaster_rlm, Sys_RoleMaster_rlm_Info>(t);
                            FindUserRole(info);
                        }
                    }
                    return info;
                }
            }
            catch (Exception Ex)
            {
                throw Ex;
            }
        }
开发者ID:Klutzdon,项目名称:PBIMSN,代码行数:28,代码来源:SysRoleMasterDA.cs


示例14: 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


示例15: 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


示例16: 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


示例17: DisplayRecord

        public ShiftTargetYieldSchedule_sty_Info DisplayRecord(IModelObject KeyObject)
        {
            ShiftTargetYieldSchedule_sty_Info displayInfo = null;

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

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

                        if (displayData != null)
                        {
                            displayInfo = Common.General.CopyObjectValue<ShiftTargetYieldSchedule_sty, ShiftTargetYieldSchedule_sty_Info>(displayData);
                        }
                    }
                }
                catch (Exception Ex)
                {

                    throw Ex;
                }
            }

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


示例18: 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


示例19: GetLastUpdateRecord

        public StopReasonMaster_srm_Info GetLastUpdateRecord()
        {
            StopReasonMaster_srm_Info result = null;

            try
            {

                //using (NHibernateTransaction.DBContext db = new NHibernateTransaction.DBContext(NHibernateTransaction.NHConfigFactory.DBConfig.HBIMSN))
                //{
                //    var data = db.CurrentSession.QueryOver<StopReasonMaster_srm_Info>().OrderBy(d => d.srm_dLastDate).Desc.Take(1).List();
                //    if (data != null && data.Count > 0)
                //    {
                //        result = data[0];
                //    }
                //}

                using (MainDBDataContext db = new MainDBDataContext())
                {
                    var mmts = from t in db.StopReasonMaster_srm
                               select t;

                    var mmt = mmts.OrderByDescending(d => d.srm_dLastDate).FirstOrDefault();
                    result = Common.General.CopyObjectValue<StopReasonMaster_srm, StopReasonMaster_srm_Info>(mmt);
                }

            }
            catch (Exception Ex)
            {
                //Logger.Error(Ex);
                //throw Ex;
            }

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


示例20: DisplayRecord

        public MailConfig_mcf_Info DisplayRecord(IModelObject KeyObject)
        {
            MailConfig_mcf_Info displayInfo = null;

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

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

                        if (displayData != null)
                        {
                            displayInfo = Common.General.CopyObjectValue<MailConfig_mcf, MailConfig_mcf_Info>(displayData);
                        }
                    }
                }
                catch (Exception Ex)
                {

                    throw Ex;
                }
            }

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



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C# LinqToTwitter.List类代码示例发布时间:2022-05-26
下一篇:
C# Data.DataConnection类代码示例发布时间:2022-05-26
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap