/// <summary>
 /// 编辑一个合格不合格检定项目
 /// </summary>
 /// <param name="validationErrors">返回的错误信息</param>
 /// <param name="entity">一个合格不合格检定项目</param>
 /// <returns></returns>
 public bool Edit(ref ValidationErrors validationErrors, QUALIFIED_UNQUALIFIED_TEST_ITE entity)
 {
     try
     {
         repository.Edit(db, entity);
         repository.Save(db);
         return(true);
     }
     catch (Exception ex)
     {
         validationErrors.Add(ex.Message);
         ExceptionsHander.WriteExceptions(ex);
     }
     return(false);
 }
Ejemplo n.º 2
0
 /// <summary>
 /// 编辑一个器具领取
 /// </summary>
 /// <param name="validationErrors">返回的错误信息</param>
 /// <param name="entity">一个器具领取</param>
 /// <returns></returns>
 public bool Edit(ref ValidationErrors validationErrors, APPLIANCECOLLECTION entity)
 {
     try
     {
         repository.Edit(db, entity);
         repository.Save(db);
         return(true);
     }
     catch (Exception ex)
     {
         validationErrors.Add(ex.Message);
         ExceptionsHander.WriteExceptions(ex);
     }
     return(false);
 }
Ejemplo n.º 3
0
 /// <summary>
 /// 编辑一个标准装置/计量标准器信息
 /// </summary>
 /// <param name="validationErrors">返回的错误信息</param>
 /// <param name="entity">一个标准装置/计量标准器信息</param>
 /// <returns></returns>
 public bool EditField(ref ValidationErrors validationErrors, METERING_STANDARD_DEVICE entity)
 {
     try
     {
         repository.EditField(db, entity);
         repository.Save(db);
         return(true);
     }
     catch (Exception ex)
     {
         validationErrors.Add(ex.Message);
         ExceptionsHander.WriteExceptions(ex);
     }
     return(false);
 }
Ejemplo n.º 4
0
 /// <summary>
 /// 编辑一个客户_企业银行账户
 /// </summary>
 /// <param name="validationErrors">返回的错误信息</param>
 /// <param name="entity">一个客户_企业银行账户</param>
 /// <returns></returns>
 public bool Edit(ref ValidationErrors validationErrors, CRM_CompanyBankAccount entity)
 {
     try
     {
         repository.Edit(db, entity);
         repository.Save(db);
         return(true);
     }
     catch (Exception ex)
     {
         validationErrors.Add(ex.Message);
         ExceptionsHander.WriteExceptions(ex);
     }
     return(false);
 }
 /// <summary>
 /// 删除一个合格不合格检定项目
 /// </summary>
 /// <param name="validationErrors">返回的错误信息</param>
 /// <param name="id">一合格不合格检定项目的主键</param>
 /// <returns></returns>
 public bool Delete(ref ValidationErrors validationErrors, string id)
 {
     try
     {
         //return repository.Delete(id) == 1;
         repository.Delete(id);
         return(true);
     }
     catch (Exception ex)
     {
         validationErrors.Add(ex.Message);
         ExceptionsHander.WriteExceptions(ex);
     }
     return(false);
 }
Ejemplo n.º 6
0
 /// <summary>
 /// 编辑一个费用_费用表其他费用
 /// </summary>
 /// <param name="validationErrors">返回的错误信息</param>
 /// <param name="entity">一个费用_费用表其他费用</param>
 /// <returns></returns>
 public bool Edit(ref ValidationErrors validationErrors, COST_CostTableOther entity)
 {
     try
     {
         repository.Edit(db, entity);
         repository.Save(db);
         return(true);
     }
     catch (Exception ex)
     {
         validationErrors.Add(ex.Message);
         ExceptionsHander.WriteExceptions(ex);
     }
     return(false);
 }
Ejemplo n.º 7
0
 /// <summary>
 /// 编辑一个不确定度参数管理
 /// </summary>
 /// <param name="validationErrors">返回的错误信息</param>
 /// <param name="entity">一个不确定度参数管理</param>
 /// <returns></returns>
 public bool Edit(ref ValidationErrors validationErrors, UNCERTAINTYPARAMETERMANAGEMENT entity)
 {
     try
     {
         repository.Edit(db, entity);
         repository.Save(db);
         return(true);
     }
     catch (Exception ex)
     {
         validationErrors.Add(ex.Message);
         ExceptionsHander.WriteExceptions(ex);
     }
     return(false);
 }
Ejemplo n.º 8
0
 /// <summary>
 /// 编辑一个变送器头
 /// </summary>
 /// <param name="validationErrors">返回的错误信息</param>
 /// <param name="entity">一个变送器头</param>
 /// <returns></returns>
 public bool Edit(ref ValidationErrors validationErrors, TRANSMITTER_HEAD entity)
 {
     try
     {
         repository.Edit(db, entity);
         repository.Save(db);
         return(true);
     }
     catch (Exception ex)
     {
         validationErrors.Add(ex.Message);
         ExceptionsHander.WriteExceptions(ex);
     }
     return(false);
 }
 /// <summary>
 /// 编辑一个菜单角色操作
 /// </summary>
 /// <param name="validationErrors">返回的错误信息</param>
 /// <param name="entity">一个菜单角色操作</param>
 /// <returns></returns>
 public bool Edit(ref ValidationErrors validationErrors, SysMenuSysRoleSysOperation entity)
 {
     try
     {
         repository.Edit(db, entity);
         repository.Save(db);
         return(true);
     }
     catch (Exception ex)
     {
         validationErrors.Add(ex.Message);
         ExceptionsHander.WriteExceptions(ex);
     }
     return(false);
 }
 /// <summary>
 /// 编辑一个员工调基历史记录
 /// </summary>
 /// <param name="validationErrors">返回的错误信息</param>
 /// <param name="entity">一个员工调基历史记录</param>
 /// <returns></returns>
 public bool Edit(ref ValidationErrors validationErrors, EmployeeGoonPaymentHistory entity)
 {
     try
     {
         repository.Edit(db, entity);
         repository.Save(db);
         return(true);
     }
     catch (Exception ex)
     {
         validationErrors.Add(ex.Message);
         ExceptionsHander.WriteExceptions(ex);
     }
     return(false);
 }
Ejemplo n.º 11
0
 /// <summary>
 /// 修改
 /// </summary>
 /// <param name="validationErrors"></param>
 /// <param name="entity"></param>
 /// <returns></returns>
 public bool EditField(ref ValidationErrors validationErrors, PREPARE_SCHEME entity)
 {
     try
     {
         repository.EditField(db, entity);
         repository.Save(db);
         return(true);
     }
     catch (Exception ex)
     {
         validationErrors.Add(ex.Message);
         ExceptionsHander.WriteExceptions(ex);
     }
     return(false);
 }
Ejemplo n.º 12
0
 /// <summary>
 /// 编辑一个实习经验
 /// </summary>
 /// <param name="validationErrors">返回的错误信息</param>
 /// <param name="entity">一个实习经验</param>
 /// <returns></returns>
 public bool Edit(ref ValidationErrors validationErrors, InternshipExperience entity)
 {
     try
     {
         repository.Edit(db, entity);
         repository.Save(db);
         return(true);
     }
     catch (Exception ex)
     {
         validationErrors.Add(ex.Message);
         ExceptionsHander.WriteExceptions(ex);
     }
     return(false);
 }
Ejemplo n.º 13
0
 /// <summary>
 /// 编辑一个交流电压交流电流
 /// </summary>
 /// <param name="validationErrors">返回的错误信息</param>
 /// <param name="entity">一个交流电压交流电流</param>
 /// <returns></returns>
 public bool Edit(ref ValidationErrors validationErrors, AC_VOLTAGE_CURRENT entity)
 {
     try
     {
         repository.Edit(db, entity);
         repository.Save(db);
         return(true);
     }
     catch (Exception ex)
     {
         validationErrors.Add(ex.Message);
         ExceptionsHander.WriteExceptions(ex);
     }
     return(false);
 }
Ejemplo n.º 14
0
 /// <summary>
 /// 编辑一个承接实验室
 /// </summary>
 /// <param name="validationErrors">返回的错误信息</param>
 /// <param name="entity">一个承接实验室</param>
 /// <returns></returns>
 public bool Edit(ref ValidationErrors validationErrors, UNDERTAKE_LABORATORY entity)
 {
     try
     {
         repository.Edit(db, entity);
         repository.Save(db);
         return(true);
     }
     catch (Exception ex)
     {
         validationErrors.Add(ex.Message);
         ExceptionsHander.WriteExceptions(ex);
     }
     return(false);
 }
Ejemplo n.º 15
0
 /// <summary>
 /// 编辑一个组织机构_人员部门范围权限
 /// </summary>
 /// <param name="validationErrors">返回的错误信息</param>
 /// <param name="entity">一个组织机构_人员部门范围权限</param>
 /// <returns></returns>
 public bool Edit(ref ValidationErrors validationErrors, ORG_UserDepartmenScopetAuthority entity)
 {
     try
     {
         repository.Edit(db, entity);
         repository.Save(db);
         return(true);
     }
     catch (Exception ex)
     {
         validationErrors.Add(ex.Message);
         ExceptionsHander.WriteExceptions(ex);
     }
     return(false);
 }
Ejemplo n.º 16
0
 /// <summary>
 /// 创建一个附件
 /// </summary>
 /// <param name="validationErrors">返回的错误信息</param>
 /// <param name="db">数据库上下文</param>
 /// <param name="entity">一个附件</param>
 /// <returns></returns>
 public bool Create(ref ValidationErrors validationErrors, FILE_UPLOADER entity)
 {
     try
     {
         //DeleteByPREPARE_SCHEMEID(entity.PREPARE_SCHEMEID,entity.CREATEPERSON);
         repository.Create(entity);
         return(true);
     }
     catch (Exception ex)
     {
         validationErrors.Add(ex.Message + "创建错误");
         validationErrors.Add(ex.Source);
         ExceptionsHander.WriteExceptions(ex);
     }
     return(false);
 }
Ejemplo n.º 17
0
 /// <summary>
 /// 编辑一个附件
 /// </summary>
 /// <param name="validationErrors">返回的错误信息</param>
 /// <param name="entity">一个附件</param>
 /// <returns></returns>
 public bool EditField(ref ValidationErrors validationErrors, FILE_UPLOADER entity)
 {
     try
     {
         repository.EditField(db, entity);
         Langben.Report.ReportBLL re = new Langben.Report.ReportBLL();
         string err = string.Empty;
         re.UpdateFuJianRemark(entity.PREPARE_SCHEMEID, out err);
         repository.Save(db);
         return(true);
     }
     catch (Exception ex)
     {
         validationErrors.Add(ex.Message);
         ExceptionsHander.WriteExceptions(ex);
     }
     return(false);
 }
Ejemplo n.º 18
0
        /// <summary>
        /// 查询的数据
        /// </summary>
        /// <param name="id">额外的参数</param>
        /// <param name="page">页码</param>
        /// <param name="rows">每页显示的行数</param>
        /// <param name="order">排序字段</param>
        /// <param name="sort">升序asc(默认)还是降序desc</param>
        /// <param name="search">查询条件</param>
        /// <param name="total">结果集的总数</param>
        /// <returns>结果集</returns>
        public List <SysPerson> GetByParam(string id, int page, int rows, string order, string sort, string search, ref int total)
        {
            try
            {
                IQueryable <SysPerson> queryData = repository.DaoChuData(db, order, sort, search);
                total = queryData.Count();
                if (total > 0)
                {
                    if (page <= 1)
                    {
                        queryData = queryData.Take(rows);
                    }
                    else
                    {
                        queryData = queryData.Skip((page - 1) * rows).Take(rows);
                    }

                    foreach (var item in queryData)
                    {
                        if (item.SysDepartmentId != null && item.SysDepartment != null)
                        {
                            item.SysDepartmentIdOld = item.SysDepartment.Name.GetString();    //
                        }

                        if (item.SysRole != null)
                        {
                            item.SysRoleId = string.Empty;
                            foreach (var it in item.SysRole)
                            {
                                item.SysRoleId += it.Name + ' ';
                            }
                        }
                    }
                }

                return(queryData.ToList());
            }
            catch (Exception ex)
            {
                ExceptionsHander.WriteExceptions(ex);
            }
            return(null);
        }
Ejemplo n.º 19
0
        public string GetYuanShiJILu(ref ValidationErrors validationErrors, string id, string shiyanshi, string leixin)
        {
            try
            {
                var data = (from f in db.APPLIANCE_LABORATORY
                            where f.APPLIANCE_DETAIL_INFORMATIONID == id && f.UNDERTAKE_LABORATORYID == shiyanshi
                            select f).First();

                var file = db.FILE_UPLOADER.Where(w => (w.PREPARE_SCHEMEID == data.PREPARE_SCHEMEID && w.STATE == "已上传") || (w.PREPARE_SCHEMEID == data.PREPARE_SCHEMEID && w.STATE2 == "已上传")).OrderBy(o => o.CREATETIME).FirstOrDefault();
                if (file != null)
                {
                    if (leixin == "Yuan")
                    {
                        //上传的报告没有路径
                        if (!file.PATH2.Contains("up"))
                        {//D:\codes\App\up\TheReport\20170323\20170323111049_7264.xls
                            string str = file.FULLPATH2.Substring(file.FULLPATH2.IndexOf("up"));
                            str = str.Replace(@"\", @"/");
                            return(str);
                        }
                        return(file.PATH2);
                    }
                    else if (leixin == "Zhenshu")
                    {
                        //上传的报告没有路径
                        if (!file.PATH.Contains("up"))
                        {//D:\codes\App\up\TheReport\20170323\20170323111049_7264.xls
                            string str = file.FULLPATH.Substring(file.FULLPATH.IndexOf("up"));
                            str = str.Replace(@"\", @"/");
                            return(str);
                        }
                        return(file.PATH);
                    }
                }
            }
            catch (Exception ex)
            {
                validationErrors.Add(ex.Message);
                ExceptionsHander.WriteExceptions(ex);
            }
            return(string.Empty);
        }
Ejemplo n.º 20
0
 /// <summary>
 /// 社保费收支费用对比
 /// </summary>
 /// <param name="validationErrors">返回的错误信息</param>
 /// <param name="yearMonth">年月</param>
 /// <param name="costType">费用类型</param>
 /// <param name="suppliersId">供应商</param>
 /// <param name="cityId">缴纳地</param>
 /// <param name="userName">当前操作用户</param>
 /// <returns></returns>
 public bool ContrastedInsurance(ref ValidationErrors validationErrors, int yearMonth, int costType, string cityId, string userName)
 {
     using (TransactionScope transactionScope = new TransactionScope())
     {
         try
         {
             repository.ContrastedInsurance(db, yearMonth, cityId, costType, userName);
             db.SaveChanges();
             transactionScope.Complete();
             return(true);
         }
         catch (Exception ex)
         {
             Transaction.Current.Rollback();
             validationErrors.Add(ex.Message);
             ExceptionsHander.WriteExceptions(ex);
             return(false);
         }
     }
 }
Ejemplo n.º 21
0
 /// <summary>
 /// 费用表作废
 /// </summary>
 /// <param name="validationErrors">返回的错误信息</param>
 /// <param name="id">费用表主键</param>
 /// <param name="status">要更新成的状态</param>
 /// <returns></returns>
 public bool CancelCostTable(ref ValidationErrors validationErrors, int id, int status)
 {
     using (TransactionScope transactionScope = new TransactionScope())
     {
         try
         {
             repository.CancelCostTable(db, id, status);
             db.SaveChanges();
             transactionScope.Complete();
             return(true);
         }
         catch (Exception ex)
         {
             Transaction.Current.Rollback();
             validationErrors.Add(ex.Message);
             ExceptionsHander.WriteExceptions(ex);
             return(false);
         }
     }
 }
Ejemplo n.º 22
0
 /// <summary>
 /// 删除支出费用
 /// </summary>
 /// <param name="validationErrors">返回的错误信息</param>
 /// <param name="id">费用_社保支出导入汇总 主键</param>
 /// <returns></returns>
 public bool DeletePayRecord(ref ValidationErrors validationErrors, int id)
 {
     using (TransactionScope transactionScope = new TransactionScope())
     {
         try
         {
             repository.DeletePayRecord(db, id);
             db.SaveChanges();
             transactionScope.Complete();
             return(true);
         }
         catch (Exception ex)
         {
             Transaction.Current.Rollback();
             validationErrors.Add(ex.Message);
             ExceptionsHander.WriteExceptions(ex);
             return(false);
         }
     }
 }
Ejemplo n.º 23
0
        public bool EditSTATUS2(ref ValidationErrors validationErrors, SIGN sign)
        {
            try
            {
                using (SysEntities sys = new SysEntities())
                {
                    sys.SIGN.Add(sign);
                    sys.SaveChanges();
                }


                return(true);
            }
            catch (Exception ex)
            {
                validationErrors.Add(ex.Message);
                ExceptionsHander.WriteExceptions(ex);
            }
            return(false);
        }
Ejemplo n.º 24
0
 /// <summary>
 /// 创建新供应商
 /// </summary>
 /// <param name="validationErrors"></param>
 /// <param name="baseModel"></param>
 /// <param name="listLink"></param>
 /// <param name="listBank"></param>
 /// <param name="listBill"></param>
 /// <param name="listPrice"></param>
 /// <param name="listLadderPrice"></param>
 /// <returns></returns>
 public bool CreateNewSupplier(ref ValidationErrors validationErrors, Supplier baseModel, List <SupplierLinkMan> listLink, List <SupplierBankAccount> listBank, List <SupplierBill> listBill, List <LadderLowestPrice> listPrice, List <LadderPrice> listLadderPrice, List <SupplierNatureCity> listCity)
 {
     try
     {
         int result = repository.CreateNewSupplier(baseModel, listLink, listBank, listBill, listPrice, listLadderPrice, listCity);
         if (result == 1)
         {
             return(true);
         }
         else
         {
             return(false);
         }
     }
     catch (Exception ex)
     {
         validationErrors.Add(ex.Message);
         ExceptionsHander.WriteExceptions(ex);
         return(false);
     }
 }
Ejemplo n.º 25
0
 /// <summary>
 /// 添加员工
 /// </summary>
 /// <param name="baseModel"></param>
 /// <param name="contactModel"></param>
 /// <param name="bankModel"></param>
 /// <returns></returns>
 public bool EmployeeAdd(ref ValidationErrors validationErrors, Employee baseModel, EmployeeContact contactModel, EmployeeBank bankModel, CompanyEmployeeRelation relationModel)
 {
     try
     {
         int result = repository.EmployeeAdd(baseModel, contactModel, bankModel, relationModel);
         if (result == 1)
         {
             return(true);
         }
         else
         {
             return(false);
         }
     }
     catch (Exception ex)
     {
         validationErrors.Add(ex.Message);
         ExceptionsHander.WriteExceptions(ex);
         return(false);
     }
 }
Ejemplo n.º 26
0
 public bool EditSupplier(ref ValidationErrors validationErrors, SupplierView model)
 {
     try
     {
         int result = repository.EditSupplier(model);
         if (result == 1)
         {
             return(true);
         }
         else
         {
             return(false);
         }
     }
     catch (Exception ex)
     {
         validationErrors.Add(ex.Message);
         ExceptionsHander.WriteExceptions(ex);
         return(false);
     }
 }
Ejemplo n.º 27
0
        public string GetYuanShiJILu(ref ValidationErrors validationErrors, string id, string shiyanshi)
        {
            try
            {
                var data = (from f in db.APPLIANCE_LABORATORY
                            where f.APPLIANCE_DETAIL_INFORMATIONID == id && f.UNDERTAKE_LABORATORYID == shiyanshi
                            select f).First();

                var file = db.FILE_UPLOADER.Where(w => w.PREPARE_SCHEMEID == data.PREPARE_SCHEMEID && w.STATE2 == "已上传").OrderBy(o => o.CREATETIME).FirstOrDefault();
                if (file != null)
                {
                    return(file.PATH2);
                }
            }
            catch (Exception ex)
            {
                validationErrors.Add(ex.Message);
                ExceptionsHander.WriteExceptions(ex);
            }
            return(string.Empty);
        }
Ejemplo n.º 28
0
 /// <summary>
 ///  创建新公司
 /// </summary>
 /// <param name="validationErrors"></param>
 /// <param name="baseModel">基本信息表</param>
 /// <param name="contractModel">合同信息表</param>
 /// <param name="branchModel">公司分支关系</param>
 /// <param name="listLink">联系人信息</param>
 /// <param name="listBank">银行信息</param>
 /// <param name="listBill">开票信息</param>
 /// <param name="listPay">回款信息</param>
 /// <param name="listPrice">报价</param>
 /// <param name="listLadderPrice">阶梯报价</param>
 /// <returns></returns>
 public bool CreateNewCompany(ref ValidationErrors validationErrors, CRM_Company baseModel, CRM_CompanyContract contractModel, CRM_CompanyToBranch branchModel, List <CRM_CompanyLinkMan> listLink, List <CRM_CompanyBankAccount> listBank, List <CRM_CompanyFinance_Bill> listBill, List <CRM_CompanyFinance_Payment> listPay, List <CRM_CompanyPrice> listPrice, List <CRM_CompanyLadderPrice> listLadderPrice, List <CRM_Company_PoliceInsurance> CompanyPoliceInsurance, List <CRM_Company_Insurance> CompanyInsurance)
 {
     try
     {
         int result = repository.CreateNewCompany(baseModel, contractModel, branchModel, listLink, listBank, listBill, listPay, listPrice, listLadderPrice, CompanyPoliceInsurance, CompanyInsurance);
         if (result == 1)
         {
             return(true);
         }
         else
         {
             return(false);
         }
     }
     catch (Exception ex)
     {
         validationErrors.Add(ex.Message);
         ExceptionsHander.WriteExceptions(ex);
         return(false);
     }
 }
Ejemplo n.º 29
0
        /// <summary>
        /// 修改密码
        /// </summary>
        /// <param name="personName">用户名</param>
        /// <param name="oldPassword">旧密码</param>
        /// <param name="newPassword">新密码</param>
        /// <returns>修改密码是否成功</returns>
        public bool ChangePassword(string personName, string oldPassword, string newPassword)
        {
            if (!string.IsNullOrWhiteSpace(personName) && !string.IsNullOrWhiteSpace(oldPassword) && !string.IsNullOrWhiteSpace(newPassword))
            {
                try
                {
                    string oldPasswordEncryptString = EncryptAndDecrypte.EncryptString(oldPassword);
                    string newPasswordEncryptString = EncryptAndDecrypte.EncryptString(newPassword);

                    using (SysEntities db = new SysEntities())
                    {
                        return(true);
                    }
                }
                catch (Exception ex)
                {
                    ExceptionsHander.WriteExceptions(ex);
                }
            }
            return(false);
        }
Ejemplo n.º 30
0
 /// <summary>
 ///  创建文档管理集合
 /// </summary>
 /// <param name="validationErrors">返回的错误信息</param>
 /// <param name="entitys">文档管理集合</param>
 /// <returns></returns>
 public bool EditCollection(ref ValidationErrors validationErrors, IQueryable <SysDocument> entitys)
 {
     if (entitys != null)
     {
         try
         {
             int flag = 0, count = entitys.Count();
             if (count > 0)
             {
                 using (TransactionScope transactionScope = new TransactionScope())
                 {
                     foreach (var entity in entitys)
                     {
                         if (Edit(ref validationErrors, db, entity))
                         {
                             flag++;
                         }
                         else
                         {
                             Transaction.Current.Rollback();
                             return(false);
                         }
                     }
                     if (count == flag)
                     {
                         transactionScope.Complete();
                         return(true);
                     }
                 }
             }
         }
         catch (Exception ex)
         {
             validationErrors.Add(ex.Message);
             ExceptionsHander.WriteExceptions(ex);
         }
     }
     return(false);
 }