public bool DeleteRecord(Model.IModel.IModelObject KeyObject) { DataRightsRole_drr_Info info = null; info = KeyObject as DataRightsRole_drr_Info; using (VPMSDBDataContext db = new VPMSDBDataContext()) { try { db.Connection.Open(); db.Transaction = db.Connection.BeginTransaction(); DataRightsRole_drr drr = db.DataRightsRole_drrs.Single <DataRightsRole_drr>(i => i.drr_iRecordID == info.drr_iRecordID); IEnumerable <DataRightsRole_TeacherList_dtl> _teacher = from t in db.DataRightsRole_TeacherList_dtls where t.dtl_cRoleNumber == drr.drr_cNumber select t; db.DataRightsRole_TeacherList_dtls.DeleteAllOnSubmit(_teacher); db.SubmitChanges(); IEnumerable <DataRightsRole_ClassList_dtc> _class = from t in db.DataRightsRole_ClassList_dtcs where t.dtc_cRoleNumber == drr.drr_cNumber select t; db.DataRightsRole_ClassList_dtcs.DeleteAllOnSubmit(_class); db.SubmitChanges(); IEnumerable <DataRightsRoleUser_dru> _roleUser = from t in db.DataRightsRoleUser_drus where t.dru_cRoleNumber == drr.drr_cNumber select t; db.DataRightsRoleUser_drus.DeleteAllOnSubmit(_roleUser); db.SubmitChanges(); //for (int i = 0; i < drr.DataRightsRole_TeacherList_dtls.Count; i++) //{ // DataRightsRole_TeacherList_dtl sta = drr.DataRightsRole_TeacherList_dtls[i]; // db.DataRightsRole_TeacherList_dtls.DeleteOnSubmit(sta); //} //for (int i = 0; i < drr.DataRightsRole_ClassList_dtcs.Count; i++) //{ // DataRightsRole_ClassList_dtc sta = drr.DataRightsRole_ClassList_dtcs[i]; // db.DataRightsRole_ClassList_dtcs.DeleteOnSubmit(sta); //} db.DataRightsRole_drrs.DeleteOnSubmit(drr); db.SubmitChanges(); db.Transaction.Commit(); return(true); } catch (Exception Ex) { db.Transaction.Rollback(); return(false); } } }
public ReturnValueInfo DeleteUserRole(string userNumber, List <string> roleNumList) { ReturnValueInfo returnInfo = new ReturnValueInfo(); returnInfo.boolValue = false; try { using (VPMSDBDataContext db = new VPMSDBDataContext()) { foreach (string roleNum in roleNumList) { IEnumerable <DataRightsRoleUser_dru> deleteTab = from t in db.DataRightsRoleUser_drus where t.dru_cRoleNumber == roleNum && t.dur_cUserLoginID == userNumber select t; if (deleteTab != null && deleteTab.Count() > 0) { db.DataRightsRoleUser_drus.DeleteAllOnSubmit(deleteTab); } } db.SubmitChanges(); returnInfo.boolValue = true; } } catch (Exception Ex) { returnInfo.boolValue = false; returnInfo.messageText = Ex.Message; } return(returnInfo); }
public Model.General.ReturnValueInfo DeleteRoleUser(DataRightsRole_drr_Info Entity) { ReturnValueInfo returnInfo = new ReturnValueInfo(); returnInfo.boolValue = false; try { using (VPMSDBDataContext db = new VPMSDBDataContext()) { foreach (Sys_UserMaster_usm_Info item in Entity.RoleUserList) { DataRightsRoleUser_dru info = db.DataRightsRoleUser_drus.SingleOrDefault <DataRightsRoleUser_dru>(t => t.dru_cRoleNumber == Entity.drr_cNumber && t.dur_cUserLoginID == item.usm_cUserLoginID); db.DataRightsRoleUser_drus.DeleteOnSubmit(info); } db.SubmitChanges(); returnInfo.boolValue = true; } } catch (Exception Ex) { returnInfo.boolValue = false; returnInfo.messageText = Ex.Message; } return(returnInfo); }
public ReturnValueInfo SaveRoleUser(DataRightsRole_drr_Info Entity) { ReturnValueInfo returnInfo = new ReturnValueInfo(); returnInfo.boolValue = false; try { using (VPMSDBDataContext db = new VPMSDBDataContext()) { //IEnumerable<DataRightsRoleUser_dru> delTab = from t in db.DataRightsRoleUser_drus // where t.dru_cRoleNumber == Entity.drr_cNumber // select t; //db.DataRightsRoleUser_drus.DeleteAllOnSubmit(delTab); foreach (Sys_UserMaster_usm_Info item in Entity.RoleUserList) { DataRightsRoleUser_dru addTab = new DataRightsRoleUser_dru(); addTab.dru_cRoleNumber = Entity.drr_cNumber; addTab.dur_cUserLoginID = item.usm_cUserLoginID; db.DataRightsRoleUser_drus.InsertOnSubmit(addTab); } db.SubmitChanges(); returnInfo.boolValue = true; } } catch (Exception Ex) { returnInfo.boolValue = false; returnInfo.messageText = Ex.Message; } return(returnInfo); }
public bool DeleteRecord(Model.IModel.IModelObject KeyObject) { bool isSuccess = false; CodeMaster_cmt_Info info = new CodeMaster_cmt_Info(); info = KeyObject as CodeMaster_cmt_Info; try { using (VPMSDBDataContext db = new VPMSDBDataContext()) { CodeMaster_cmt delTab = db.CodeMaster_cmts.SingleOrDefault(t => t.cmt_iRecordID == info.cmt_iRecordID); if (delTab != null) { db.CodeMaster_cmts.DeleteOnSubmit(delTab); db.SubmitChanges(); isSuccess = true; } } } catch (Exception Ex) { throw Ex; } return(isSuccess); }
public Model.General.ReturnValueInfo Web_UserMaster_Pwd(Web_Sys_UserMaster_usm_PWD info) { Model.General.ReturnValueInfo returnValue = new Model.General.ReturnValueInfo(); returnValue.boolValue = false; try { using (VPMSDBDataContext db = new VPMSDBDataContext()) { Sys_UserMaster_usm tab = db.Sys_UserMaster_usms.SingleOrDefault(t => t.usm_cUserLoginID == info.usm_cUserLoginID && t.usm_cPasswork == info.usm_cOldPasswork); if (tab != null) { tab.usm_cPasswork = info.usm_cNewPasswork; db.SubmitChanges(); returnValue.boolValue = true; returnValue.messageText = "修改成功!"; } else { returnValue.messageText = "旧密码有误,请重新输入!"; } } } catch (Exception Ex) { throw Ex; } return(returnValue); }
public bool UpdateRecord(CodeMaster_cmt_Info infoObject) { bool isSuccess = false; try { using (VPMSDBDataContext db = new VPMSDBDataContext()) { CodeMaster_cmt query = db.CodeMaster_cmts.SingleOrDefault(t => t.cmt_iRecordID == infoObject.cmt_iRecordID); if (query != null) { query.cmt_cKey1 = infoObject.cmt_cKey1; query.cmt_cKey2 = infoObject.cmt_cKey2; query.cmt_cValue = infoObject.cmt_cValue; query.cmt_fNumber = infoObject.cmt_fNumber; query.cmt_cRemark = infoObject.cmt_cRemark; query.cmt_cRemark2 = infoObject.cmt_cRemark2; query.cmt_cLast = infoObject.cmt_cLast; query.cmt_dLastDate = infoObject.cmt_dLastDate; db.SubmitChanges(); isSuccess = true; } } } catch (Exception Ex) { throw Ex; } return(isSuccess); }
public bool DeleteRecord(Model.IModel.IModelObject KeyObject) { SpecialtyMaster_spm_Info info = null; try { info = KeyObject as SpecialtyMaster_spm_Info; using (VPMSDBDataContext db = new VPMSDBDataContext()) { SpecialtyMaster_spm spm = db.SpecialtyMaster_spms.Single <SpecialtyMaster_spm>(i => i.spm_iRecordID == info.spm_iRecordID); for (int i = 0; i < spm.SpecialtyMasterCourse_smcs.Count; i++) { SpecialtyMasterCourse_smc sta = spm.SpecialtyMasterCourse_smcs[i]; db.SpecialtyMasterCourse_smcs.DeleteOnSubmit(sta); } db.SpecialtyMaster_spms.DeleteOnSubmit(spm); db.SubmitChanges(); } return(true); } catch (Exception Ex) { throw Ex; } }
public bool UpdateRecord(SpecialtyMaster_spm_Info infoObject) { using (VPMSDBDataContext db = new VPMSDBDataContext()) { SpecialtyMaster_spm spm = new SpecialtyMaster_spm(); try { spm = db.SpecialtyMaster_spms.SingleOrDefault(t => t.spm_iRecordID == infoObject.spm_iRecordID); for (int i = 0; i < spm.SpecialtyMasterCourse_smcs.Count; i++) { SpecialtyMasterCourse_smc sta = spm.SpecialtyMasterCourse_smcs[i]; db.SpecialtyMasterCourse_smcs.DeleteOnSubmit(sta); } if (spm != null) { spm.spm_cName = infoObject.spm_cName; spm.spm_cNumber = infoObject.spm_cNumber; spm.spm_cRemark = infoObject.spm_cRemark; spm.spm_cLast = infoObject.spm_cLast; spm.spm_dLastDate = infoObject.spm_dLastDate.Value; db.SubmitChanges(); } return(true); } catch (Exception Ex) { throw Ex; } } }
public bool InsertRecord(SpecialtyMaster_spm_Info infoObject) { if (infoObject == null) { return(false); } using (VPMSDBDataContext db = new VPMSDBDataContext()) { SpecialtyMaster_spm spm = new SpecialtyMaster_spm(); try { spm = Common.General.CopyObjectValue <Model.Management.Master.SpecialtyMaster_spm_Info, SpecialtyMaster_spm>(infoObject); IQueryable <SpecialtyMaster_spm> taQuery = (from spms in db.SpecialtyMaster_spms where spms.spm_cNumber == spm.spm_cNumber select spms); db.SpecialtyMaster_spms.InsertOnSubmit(spm); db.SubmitChanges(); return(true); } catch (Exception Ex) { throw Ex; } } }
public bool UpdateRecord(Model.Management.Master.BuildingMaster_bdm_Info infoObject) { BuildingMaster_bdm tab = new BuildingMaster_bdm(); bool isSuccess = false; try { using (VPMSDBDataContext db = new VPMSDBDataContext()) { tab = db.BuildingMaster_bdms.SingleOrDefault(t => t.bdm_cNumber == infoObject.bdm_cNumber); if (tab != null) { tab.bdm_cName = infoObject.bdm_cName; tab.bdm_cRemark = infoObject.bdm_cRemark; tab.bdm_cLast = infoObject.bdm_cLast; tab.bdm_dLastDate = (infoObject.bdm_dLastDate != null?infoObject.bdm_dLastDate.Value:DateTime.Now); } db.SubmitChanges(); isSuccess = true; } } catch (Exception Ex) { throw Ex; } return(isSuccess); }
public Model.IModel.IModelObject SaveUserSkin(Model.IModel.IModelObject Entity) { UserSkin_urs_Info info = new UserSkin_urs_Info(); try { using (VPMSDBDataContext db = new VPMSDBDataContext()) { info = Entity as UserSkin_urs_Info; UserSkin_ur query = db.UserSkin_urs.SingleOrDefault(t => t.urs_cUserID == info.urs_cUserID); if (query != null) { query.urs_cSkinName = info.urs_cSkinName; } else { UserSkin_ur newTab = new UserSkin_ur(); newTab.urs_cUserID = info.urs_cUserID; newTab.urs_cSkinName = info.urs_cSkinName; db.UserSkin_urs.InsertOnSubmit(newTab); } db.SubmitChanges(); } } catch (Exception Ex) { throw Ex; } return(info); }
/// <summary> /// 解记录锁 /// </summary> /// <param name="tableName">数据表名称</param> /// <param name="keys">主键字符串</param> /// <param name="userID">用户ID</param> /// <returns></returns> public static ReturnValueInfo UnLockRecord(VPMSDBDataContext dbDataContext, string tableName, long recordID, string userID) { if (dbDataContext == null) { throw new Exception("dbDataContext is null !"); } ReturnValueInfo retrunInfo = null; Sys_RecordLockRegister_rlr recordInfo = null; try { recordInfo = dbDataContext.Sys_RecordLockRegister_rlrs.SingleOrDefault <Sys_RecordLockRegister_rlr>(t => t.rlr_cTableName == tableName && t.rlr_iByLockRecordID == recordID && t.rlr_cLockedBy == userID); retrunInfo = new ReturnValueInfo(); if (recordInfo != null) { dbDataContext.Sys_RecordLockRegister_rlrs.DeleteOnSubmit(recordInfo); dbDataContext.SubmitChanges(); } retrunInfo.boolValue = true; } catch (Exception Ex) { throw Ex; } return(retrunInfo); }
public bool InsertRecord(Sys_SupplierMaster_slm_Info infoObject) { bool isSuccess = false; if (infoObject != null) { try { using (VPMSDBDataContext db = new VPMSDBDataContext()) { SupplierMaster_slm supplierMaster = Common.General.CopyObjectValue <Sys_SupplierMaster_slm_Info, SupplierMaster_slm>(infoObject); db.SupplierMaster_slm.InsertOnSubmit(supplierMaster); db.SubmitChanges(); isSuccess = true; } } catch (Exception Ex) { throw Ex; } } return(isSuccess); }
public bool DeleteRecord(Model.IModel.IModelObject KeyObject) { Sys_FormMaster_fom_Info info = null; try { info = KeyObject as Sys_FormMaster_fom_Info; using (VPMSDBDataContext db = new VPMSDBDataContext()) { Sys_FormMaster_fom frm = db.Sys_FormMaster_foms.Single <Sys_FormMaster_fom>(i => i.fom_iRecordID == info.fom_iRecordID); for (int i = 0; i < frm.Sys_FormPurview_frps.Count; i++) { Sys_FormPurview_frp sta = frm.Sys_FormPurview_frps[i]; db.Sys_FormPurview_frps.DeleteOnSubmit(sta); } db.Sys_FormMaster_foms.DeleteOnSubmit(frm); db.SubmitChanges(); return(true); } } catch (Exception Ex) { throw Ex; } }
public bool UpdateRecord(Model.Management.Master.SchoolMaster_scm_Info infoObject) { SchoolMaster_scm tab = new SchoolMaster_scm(); bool isSuccess = false; try { using (VPMSDBDataContext db = new VPMSDBDataContext()) { tab = db.SchoolMaster_scm.SingleOrDefault(t => t.scm_cNumber == infoObject.scm_cNumber); if (tab != null) { tab.scm_cName = infoObject.scm_cName; tab.scm_cRemark = infoObject.scm_cRemark; tab.scm_cLast = infoObject.scm_cLast; tab.scm_dLastDate = infoObject.scm_dLastDate; //tab=Common.General.SetDataToLingQEntity(tab, infoObject); } db.SubmitChanges(); isSuccess = true; } } catch (Exception Ex) { throw Ex; } return(isSuccess); }
public bool UpdateRecord(Model.Management.Master.SiteMaster_stm_Info infoObject) { using (VPMSDBDataContext db = new VPMSDBDataContext()) { SiteMaster_stm stm = new SiteMaster_stm(); try { stm = db.SiteMaster_stms.SingleOrDefault(t => t.stm_iRecordID == infoObject.stm_iRecordID); if (stm != null) { stm.stm_cBuildingNumber = infoObject.stm_cBuildingNumber; stm.stm_cName = infoObject.stm_cName; stm.stm_cNumber = infoObject.stm_cNumber; stm.stm_cRemark = infoObject.stm_cRemark; stm.stm_cLast = infoObject.stm_cLast; stm.stm_dLastDate = infoObject.stm_dLastDate.Value; db.SubmitChanges(); } return(true); } catch (Exception Ex) { throw Ex; } } }
public bool DeleteRecord(Model.IModel.IModelObject KeyObject) { Sys_RoleMaster_rlm_Info info = null; try { info = KeyObject as Sys_RoleMaster_rlm_Info; using (VPMSDBDataContext db = new VPMSDBDataContext()) { Sys_RoleMaster_rlm rlm = db.Sys_RoleMaster_rlms.Single <Sys_RoleMaster_rlm>(i => i.rlm_iRecordID == info.rlm_iRecordID); for (int i = 0; i < rlm.Sys_UserRoles_usrs.Count; i++) { Sys_UserRoles_usr sta = rlm.Sys_UserRoles_usrs[i]; db.Sys_UserRoles_usrs.DeleteOnSubmit(sta); } db.Sys_RoleMaster_rlms.DeleteOnSubmit(rlm); db.SubmitChanges(); return(true); } } catch (Exception Ex) { throw Ex; } }
/// <summary> /// 新增蔬菜品种主档记录 /// </summary> /// <param name="infoObject"></param> /// <returns></returns> public bool InsertRecord(VegetableSpeciesMaster_vsm_Info infoObject) { bool isSuccess = false; if (infoObject != null) { try { using (VPMSDBDataContext db = new VPMSDBDataContext()) { VegetableSpeciesMaster_vsm vegetableSpeciesMaster = Common.General.CopyObjectValue <VegetableSpeciesMaster_vsm_Info, VegetableSpeciesMaster_vsm>(infoObject); db.VegetableSpeciesMaster_vsm.InsertOnSubmit(vegetableSpeciesMaster); this.InsertVegetableSpeciesTransactionTime(db, infoObject.VegetableSpeciesTransactionTimes); this.InsertVegetableSpeciesMasterCost(db, infoObject.VegetableSpeciesMasterCosts); this.InsertVegetableSpeciesPerdictYield(db, infoObject.VegetableSpeciesPerdictYields); this.InsertVegetableSpeciesSuitPlantTime(db, infoObject.VegetableSpeciesSuitPlantTimes); db.SubmitChanges(); isSuccess = true; } } catch (Exception Ex) { throw Ex; } } return(isSuccess); }
public bool DeleteRecord(Model.IModel.IModelObject KeyObject) { bool isSuccess = false; VegetableSpeciesMaster_vsm_Info keyObject = KeyObject as VegetableSpeciesMaster_vsm_Info; if (keyObject != null) { try { using (VPMSDBDataContext db = new VPMSDBDataContext()) { VegetableSpeciesMaster_vsm vegetableSpeciesMaster = db.VegetableSpeciesMaster_vsm.FirstOrDefault(t => t.vsm_RecordID == keyObject.vsm_RecordID); if (vegetableSpeciesMaster != null) { db.VegetableSpeciesMaster_vsm.DeleteOnSubmit(vegetableSpeciesMaster); db.SubmitChanges(); isSuccess = true; } } } catch (Exception Ex) { throw Ex; } } return(isSuccess); }
public bool InsertRecord(ArticleTypeDefine_atd_Info infoObject) { bool isSuccess = false; if (infoObject != null) { try { using (VPMSDBDataContext db = new VPMSDBDataContext()) { ArticleTypeDefine_atd insertInfo = Common.General.CopyObjectValue <ArticleTypeDefine_atd_Info, ArticleTypeDefine_atd>(infoObject); if (insertInfo != null) { db.ArticleTypeDefine_atds.InsertOnSubmit(insertInfo); db.SubmitChanges(); isSuccess = true; } } } catch (Exception Ex) { throw Ex; } } return(isSuccess); }
private void DeleteChildrenRecord(ArticleTypeDefine_atd deleteInfo) { if (deleteInfo != null) { try { using (VPMSDBDataContext db = new VPMSDBDataContext()) { IEnumerable <ArticleTypeDefine_atd> delTabs = from t in db.ArticleTypeDefine_atds where t.atd_cParentRecordNum == deleteInfo.atd_cTypeNum select t; if (delTabs != null && delTabs.Count() > 0) { foreach (ArticleTypeDefine_atd deleteItem in delTabs) { if (HasChild(deleteItem)) { DeleteChildrenRecord(deleteItem); } } db.ArticleTypeDefine_atds.DeleteAllOnSubmit(delTabs); db.SubmitChanges(); } } } catch (Exception Ex) { throw Ex; } } }
public bool DeleteRecord(IModelObject KeyObject) { bool isSuccess = false; if (KeyObject != null) { try { using (VPMSDBDataContext db = new VPMSDBDataContext()) { SupplierMaster_slm supplierMaster = db.SupplierMaster_slm.FirstOrDefault(t => t.slm_iRecordID == (KeyObject as Sys_SupplierMaster_slm_Info).slm_iRecordID); if (supplierMaster != null) { db.SupplierMaster_slm.DeleteOnSubmit(supplierMaster); db.SubmitChanges(); isSuccess = true; } } } catch (Exception Ex) { throw Ex; } } return(isSuccess); }
public bool InsertRecord(Sys_UserPurview_usp_Info infoObject) { Sys_UserPurview_usp_Info uspInfo = new Sys_UserPurview_usp_Info(); Sys_FormMaster_fom_Info formInfo = new Sys_FormMaster_fom_Info(); Sys_UserMaster_usm_Info userInfo = null; Sys_RoleMaster_rlm_Info roleInfo = null; using (VPMSDBDataContext db = new VPMSDBDataContext()) { try { formInfo = infoObject.formMasterList[0]; DelUserPurview(infoObject); for (int i = 0; i < infoObject.userMasterList.Count; i++) { for (int j = 0; j < infoObject.userMasterList[i].functionMasterList.Count; j++) { Sys_UserPurview_usp uspUser = new Sys_UserPurview_usp(); uspUser = Common.General.CopyObjectValue <Sys_UserPurview_usp_Info, Sys_UserPurview_usp>(infoObject); userInfo = new Sys_UserMaster_usm_Info(); userInfo = infoObject.userMasterList[i]; uspUser.usp_cUserLoginID = userInfo.usm_cUserLoginID; uspUser.usp_cPurviewCode = infoObject.userMasterList[i].functionMasterList[j].fum_cFunctionNumber + formInfo.fom_cFormNumber; uspUser.usp_cAdd = infoObject.usp_cAdd; uspUser.usp_cLast = infoObject.usp_cLast; uspUser.usp_dAddDate = infoObject.usp_dAddDate.Value; uspUser.usp_dLastDate = infoObject.usp_dLastDate.Value; db.Sys_UserPurview_usps.InsertOnSubmit(uspUser); } } for (int i = 0; i < infoObject.roleMasterList.Count; i++) { for (int j = 0; j < infoObject.roleMasterList[i].functionMasterList.Count; j++) { Sys_UserPurview_usp uspUser = new Sys_UserPurview_usp(); uspUser = Common.General.CopyObjectValue <Sys_UserPurview_usp_Info, Sys_UserPurview_usp>(infoObject); roleInfo = new Sys_RoleMaster_rlm_Info(); roleInfo = infoObject.roleMasterList[i]; uspUser.usp_cRoleID = roleInfo.rlm_cRoleID; uspUser.usp_cPurviewCode = infoObject.roleMasterList[i].functionMasterList[j].fum_cFunctionNumber + formInfo.fom_cFormNumber; uspUser.usp_cAdd = infoObject.usp_cAdd; uspUser.usp_cLast = infoObject.usp_cLast; uspUser.usp_dAddDate = infoObject.usp_dAddDate.Value; uspUser.usp_dLastDate = infoObject.usp_dLastDate.Value; db.Sys_UserPurview_usps.InsertOnSubmit(uspUser); } } db.SubmitChanges(); return(true); } catch (Exception Ex) { throw Ex; } } }
/// <summary> /// 记录日志 /// </summary> /// <param name="p_objLog"></param> public void InsertLog(LogDetail_lgd_Info p_objLog) { using (VPMSDBDataContext db = new VPMSDBDataContext()) { LogDetail_lgd l_objNewLog = Common.General.CopyObjectValue <LogDetail_lgd_Info, LogDetail_lgd>(p_objLog); db.LogDetail_lgds.InsertOnSubmit(l_objNewLog); db.SubmitChanges(); } }
public bool DeleteRecord(IModelObject KeyObject) { bool isSuccess = false; if (KeyObject != null) { try { try { using (VPMSDBDataContext db = new VPMSDBDataContext()) { ArticleTypeDefine_atd_Info deleteInfo = KeyObject as ArticleTypeDefine_atd_Info; ArticleTypeDefine_atd deleteRecord = db.ArticleTypeDefine_atds.FirstOrDefault(t => t.atd_iRecordID == deleteInfo.atd_iRecordID); if (deleteRecord != null) { if (HasChild(deleteRecord)) { //deleteInfo = Common.General.CopyObjectValue<ArticleTypeDefine_atd, ArticleTypeDefine_atd_Info>(deleteRecord); //foreach (ArticleTypeDefine_atd_Info deleteItem in GetAllChildren(deleteInfo)) //{ // ArticleTypeDefine_atd delRecord = new ArticleTypeDefine_atd(); // delRecord.atd_cTypeNum = deleteItem.atd_cTypeNum; //} DeleteChildrenRecord(deleteRecord); } db.ArticleTypeDefine_atds.DeleteOnSubmit(deleteRecord); db.SubmitChanges(); isSuccess = true; } } } catch (Exception Ex) { throw Ex; } } catch (Exception Ex) { throw Ex; } } return(isSuccess); }
public bool UpdateRecord(Sys_SupplierMaster_slm_Info infoObject) { bool isSuccess = false; if (infoObject != null) { try { using (VPMSDBDataContext db = new VPMSDBDataContext()) { SupplierMaster_slm supplierMaster = db.SupplierMaster_slm.FirstOrDefault(t => t.slm_iRecordID == infoObject.slm_iRecordID); if (supplierMaster != null) { supplierMaster.slm_cChinaName = infoObject.slm_cChinaName; supplierMaster.slm_cEnglishName = infoObject.slm_cEnglishName; supplierMaster.slm_cTaxNumber = infoObject.slm_cTaxNumber; supplierMaster.slm_cLinkman = infoObject.slm_cLinkman; supplierMaster.slm_cAddress = infoObject.slm_cAddress; supplierMaster.slm_cPhone = infoObject.slm_cPhone; supplierMaster.slm_cFax = infoObject.slm_cFax; supplierMaster.slm_cWebSite = infoObject.slm_cWebSite; supplierMaster.slm_cRemark = infoObject.slm_cRemark; supplierMaster.slm_dLastDate = DateTime.Now; supplierMaster.slm_cLast = infoObject.slm_cLast; db.SubmitChanges(); isSuccess = true; } } } catch (Exception Ex) { throw Ex; } } return(isSuccess); }
public bool InsertRecord(Sys_RoleMaster_rlm_Info infoObject) { if (infoObject == null) { return(false); } using (VPMSDBDataContext db = new VPMSDBDataContext()) { Sys_RoleMaster_rlm rlm = new Sys_RoleMaster_rlm(); try { rlm = Common.General.CopyObjectValue <Sys_RoleMaster_rlm_Info, Sys_RoleMaster_rlm>(infoObject); if (infoObject.userMasterList != null && infoObject.userMasterList.Count > 0) { for (int i = 0; i < infoObject.userMasterList.Count; i++) { Sys_UserMaster_usm_Info usmInfo = infoObject.userMasterList[i]; Sys_UserRoles_usr item = new Sys_UserRoles_usr(); item.usr_cUserLoginID = usmInfo.usm_cUserLoginID; item.usr_cRoleID = infoObject.rlm_cRoleID; //courseitem.cum_cNumber; rlm.Sys_UserRoles_usrs.Add(item); //db.Sys_UserRoles_usrs.InsertOnSubmit(item); } } db.Sys_RoleMaster_rlms.InsertOnSubmit(rlm); db.SubmitChanges(); return(true); } catch (Exception Ex) { throw Ex; } } }
public bool DeleteRecord(Model.IModel.IModelObject KeyObject) { Model.SysMaster.DepartmentMaster_dpm_Info info = null; try { info = KeyObject as Model.SysMaster.DepartmentMaster_dpm_Info; using (VPMSDBDataContext db = new VPMSDBDataContext()) { DepartmentMaster_dpm dpm = db.DepartmentMaster_dpms.Single <DepartmentMaster_dpm>(i => i.dpm_iRecordID == info.dpm_iRecordID); db.DepartmentMaster_dpms.DeleteOnSubmit(dpm); db.SubmitChanges(); return(true); } } catch (Exception Ex) { throw Ex; } }
public bool InsertRecord(Model.SysMaster.DepartmentMaster_dpm_Info infoObject) { using (VPMSDBDataContext db = new VPMSDBDataContext()) { DepartmentMaster_dpm dpm = new DepartmentMaster_dpm(); try { dpm = Common.General.CopyObjectValue <model.DepartmentMaster_dpm_Info, DepartmentMaster_dpm>(infoObject); db.DepartmentMaster_dpms.InsertOnSubmit(dpm); db.SubmitChanges(); return(true); } catch (Exception Ex) { throw Ex; } } }