Example #1
0
        /// <summary>
        /// 更新其他往来单位信息
        /// </summary>
        /// <param name="model"></param>
        /// <returns></returns>
        public static bool UpdateCropInfo(OtherCorpInfoModel model)
        {
            UserInfoUtil userInfo = (UserInfoUtil)SessionUtil.Session["UserInfo"];

            //登陆日志
            try
            {
                bool         succ     = false;
                LogInfoModel logModel = InitLogInfo(model.CustNo);
                logModel.Element = ConstUtil.LOG_PROCESS_UPDATE;
                succ             = OtherCorpInfoDBHelper.UpdateOtherCorpInfo(model);
                if (!succ)
                {
                    logModel.Remark = ConstUtil.LOG_PROCESS_FAILED;
                }
                else
                {
                    logModel.Remark = ConstUtil.LOG_PROCESS_SUCCESS;
                }
                LogDBHelper.InsertLog(logModel);
                return(succ);
            }
            catch (Exception)
            {
                return(false);

                throw;
            }
        }
Example #2
0
        /// <summary>
        /// 插入其他往来单位
        /// </summary>
        /// <param name="model"></param>
        /// <returns></returns>
        public static bool InsertCropInfo(OtherCorpInfoModel model)
        {
            UserInfoUtil userInfo = (UserInfoUtil)SessionUtil.Session["UserInfo"];

            //登陆日志
            try
            {
                bool         succ     = false;
                LogInfoModel logModel = InitLogInfo(model.CustNo);
                logModel.Element = ConstUtil.LOG_PROCESS_INSERT;
                succ             = OtherCorpInfoDBHelper.InsertOtherCorpInfo(model);
                if (!succ)
                {
                    logModel.Remark = ConstUtil.LOG_PROCESS_FAILED;
                }
                else
                {
                    logModel.Remark = ConstUtil.LOG_PROCESS_SUCCESS;
                }
                LogDBHelper.InsertLog(logModel);
                return(succ);
            }
            catch (Exception ex)
            {
                WriteSystemLog(userInfo, ex);
                return(false);
            }
        }
Example #3
0
        public static OtherCorpInfoModel GetOtherCorpById(int Id)
        {
            try
            {
                return(OtherCorpInfoDBHelper.GetOtherCorpById(Id));
            }
            catch (Exception)
            {
                return(null);

                throw;
            }
        }
Example #4
0
        /// <summary>
        /// 根据企业编码获取企业其他往来客户信息
        /// </summary>
        /// <param name="CompanyCD">企业编码</param>
        /// <returns>DataTable</returns>
        public static DataTable GetOtherCorpInfo()
        {
            string CompanyCD = ((UserInfoUtil)SessionUtil.Session["UserInfo"]).CompanyCD;

            try
            {
                return(OtherCorpInfoDBHelper.GetOtherCorpInfo(CompanyCD));
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }
Example #5
0
        /// <summary>
        /// 查询往来单位信息
        /// </summary>
        /// <param name="model"></param>
        /// <returns></returns>
        public static DataTable SearchRectOtherCorpInfo(OtherCorpInfoModel model, int pageIndex, int pageCount, string OrderBy, ref int totalCount)
        {
            try
            {
                UserInfoUtil userInfo = (UserInfoUtil)SessionUtil.Session["UserInfo"];
                model.CompanyCD = userInfo.CompanyCD;
                //model.CompanyCD = "AAAAAA";
                return(OtherCorpInfoDBHelper.SearchRectOtherCorpInfo(model, pageIndex, pageCount, OrderBy, ref totalCount));
            }
            catch (Exception)
            {
                return(null);

                throw;
            }
        }
Example #6
0
        /// <summary>
        /// 删除往来单位信息
        /// </summary>
        /// <param name="ID"></param>
        /// <param name="CompanyCD"></param>
        /// <returns></returns>
        public static bool DeleteOtherCorpInfo(string ID)
        {
            if (string.IsNullOrEmpty(ID))
            {
                return(false);
            }
            UserInfoUtil userInfo  = (UserInfoUtil)SessionUtil.Session["UserInfo"];
            string       CompanyCD = userInfo.CompanyCD;
            //string CompanyCD = "AAAAAA";
            bool isSucc = OtherCorpInfoDBHelper.DeleteOtherCorpInfo(ID, CompanyCD);
            //定义变量
            string remark;

            //成功时
            if (isSucc)
            {
                //设置操作成功标识
                remark = ConstUtil.LOG_PROCESS_SUCCESS;
            }
            else
            {
                //设置操作成功标识
                remark = ConstUtil.LOG_PROCESS_FAILED;
            }
            //获取删除的编号列表
            string[] noList = ID.Split(',');
            //遍历所有编号,登陆操作日志
            for (int i = 0; i < noList.Length; i++)
            {
                //获取编号
                string no = noList[i];
                //替换两边的 '
                no = no.Replace("'", string.Empty);

                //操作日志
                LogInfoModel logModel = InitLogInfo("其他往来单位ID:" + no);
                //涉及关键元素 这个需要根据每个页面具体设置,本页面暂时设置为空
                logModel.Element = ConstUtil.LOG_PROCESS_DELETE;
                //设置操作成功标识
                logModel.Remark = remark;

                //登陆日志
                LogDBHelper.InsertLog(logModel);
            }
            return(isSucc);
        }