Exemplo n.º 1
0
        /// <summary>
        /// 采购模板添加,返回1成功,其它失败
        /// </summary>
        /// <param name="info">实体</param>
        /// <returns></returns>
        public int MoBan_C(EyouSoft.Model.MCaiGouMoBanInfo info)
        {
            if (info == null ||
                string.IsNullOrEmpty(info.CaoZuoRenId) ||
                string.IsNullOrEmpty(info.Name) ||
                string.IsNullOrEmpty(info.CgsId))
            {
                return(0);
            }
            if (info.ChanPins == null || info.ChanPins.Count == 0)
            {
                return(0);
            }

            info.MoBanId   = Guid.NewGuid().ToString();
            info.IssueTime = DateTime.Now;

            foreach (var item in info.ChanPins)
            {
                item.Id = Guid.NewGuid().ToString();
            }

            int dalRetCode = dal.MoBan_CU(info);

            if (dalRetCode == 1)
            {
                var logInfo = new EyouSoft.Model.MCaoZuoLogInfo();
                logInfo.BiaoTi     = "添加采购模板";
                logInfo.NeiRong    = "添加采购模板,模板编号:" + info.MoBanId + "。";
                logInfo.GuanLianId = info.MoBanId;
                BCaoZuoLog.Log_C(logInfo);
            }
            return(dalRetCode);
        }
Exemplo n.º 2
0
        /// <summary>
        /// 用户注册,返回1成功,其它失败
        /// </summary>
        /// <param name="info">实体</param>
        /// <returns></returns>
        public int YongHu_ZhuCe(EyouSoft.Model.MZhuCeYongHuInfo info)
        {
            if (info == null ||
                string.IsNullOrEmpty(info.GongSiName) ||
                string.IsNullOrEmpty(info.YongHuMing) ||
                string.IsNullOrEmpty(info.PasswordMD5))
            {
                return(0);
            }

            info.GongSiId  = Guid.NewGuid().ToString();
            info.YongHuId  = Guid.NewGuid().ToString();
            info.IssueTime = DateTime.Now;

            int dalRetCode = dal.YongHu_ZhuCe(info);

            if (dalRetCode == 1)
            {
                var logInfo = new EyouSoft.Model.MCaoZuoLogInfo();
                logInfo.BiaoTi     = "用户注册";
                logInfo.NeiRong    = "用户注册,用户编号:" + info.YongHuId + "。";
                logInfo.GuanLianId = info.YongHuId;
                BCaoZuoLog.Log_C(logInfo);
            }
            return(dalRetCode);
        }
Exemplo n.º 3
0
        /// <summary>
        /// 供应商到货确认,返回1成功,其它失败
        /// </summary>
        /// <param name="dingDanId">订单编号</param>
        /// <param name="caoZuoRenId">操作人编号</param>
        /// <returns></returns>
        public int GysDaoHuoQueRen(string dingDanId, string caoZuoRenId)
        {
            if (string.IsNullOrEmpty(dingDanId) || string.IsNullOrEmpty(caoZuoRenId))
            {
                return(0);
            }
            var info = GetInfo(dingDanId);

            if (info == null)
            {
                return(-1);
            }
            if (info.Status != EyouSoft.Model.DingDanStatus.采购商确认收货)
            {
                return(-2);
            }

            int dalRetCode = dal.SheZhiGysDaoHuoQueRenStatus(dingDanId, EyouSoft.Model.QueRenStatus.已确认, caoZuoRenId, DateTime.Now);

            if (dalRetCode == 1)
            {
                var logInfo = new EyouSoft.Model.MCaoZuoLogInfo();
                logInfo.BiaoTi     = "到货确认";
                logInfo.NeiRong    = "到货确认,订单编号:" + info.DingDanId + "。";
                logInfo.GuanLianId = info.DingDanId;
                BCaoZuoLog.Log_C(logInfo);
            }
            return(dalRetCode);
        }
Exemplo n.º 4
0
        /// <summary>
        /// 采购商、供应商、平台用户信息修改,返回1成功,其它失败
        /// </summary>
        /// <param name="info">实体</param>
        /// <returns></returns>
        public int YongHu_U(EyouSoft.Model.MYongHuInfo info)
        {
            if (info == null ||
                string.IsNullOrEmpty(info.Username) ||
                string.IsNullOrEmpty(info.YongHuId) ||
                string.IsNullOrEmpty(info.CaoZuoRenId) ||
                string.IsNullOrEmpty(info.GongSiId))
            {
                return(0);
            }

            info.IssueTime = DateTime.Now;

            int dalRetCode = dal.YongHu_CU(info);

            if (dalRetCode == 1)
            {
                var logInfo = new EyouSoft.Model.MCaoZuoLogInfo();
                logInfo.BiaoTi     = "修改用户信息";
                logInfo.NeiRong    = "修改用户信息,用户编号:" + info.YongHuId + "。";
                logInfo.GuanLianId = info.YongHuId;
                BCaoZuoLog.Log_C(logInfo);
            }
            return(dalRetCode);
        }
Exemplo n.º 5
0
        /// <summary>
        /// 产品修改,返回1成功,其它失败
        /// </summary>
        /// <param name="info">实体</param>
        /// <returns></returns>
        public int ChanPin_U(EyouSoft.Model.MChanPinInfo info)
        {
            if (info == null ||
                string.IsNullOrEmpty(info.CaoZuoRenId) ||
                string.IsNullOrEmpty(info.GysId) ||
                string.IsNullOrEmpty(info.Name) ||
                string.IsNullOrEmpty(info.ChanPinId))
            {
                return(0);
            }

            info.IssueTime = DateTime.Now;

            int dalRetCode = dal.ChanPin_CU(info);

            if (dalRetCode == 1)
            {
                var logInfo = new EyouSoft.Model.MCaoZuoLogInfo();
                logInfo.BiaoTi     = "修改产品信息";
                logInfo.NeiRong    = "修改产品信息,产品编号:" + info.ChanPinId + "。";
                logInfo.GuanLianId = info.ChanPinId;
                BCaoZuoLog.Log_C(logInfo);
            }
            return(dalRetCode);
        }
Exemplo n.º 6
0
        /// <summary>
        /// 采购单发布,返回1成功,其它失败
        /// </summary>
        /// <param name="cgsId">采购商编号</param>
        /// <param name="caiGouDanId">采购单编号</param>
        /// <param name="caoZuoRenId">操作人编号</param>
        /// <returns></returns>
        public int FaBu(string cgsId, string caiGouDanId, string caoZuoRenId)
        {
            if (string.IsNullOrEmpty(cgsId) || string.IsNullOrEmpty(caiGouDanId) || string.IsNullOrEmpty(caoZuoRenId))
            {
                return(0);
            }

            int dalRetCode = dal.SheZhiStatus(cgsId, caiGouDanId, EyouSoft.Model.CaiGouDanStatus.已下单, caoZuoRenId, DateTime.Now);

            #region 消息处理
            if (dalRetCode == 1)
            {
                var xiaoXiInfo = new EyouSoft.Model.MXiaoXiInfo();

                xiaoXiInfo.BiaoTi          = "待报价";
                xiaoXiInfo.ChuLiRenId      = string.Empty;
                xiaoXiInfo.ChuLiTime       = null;
                xiaoXiInfo.FaChuGongSiId   = cgsId;
                xiaoXiInfo.FaChuRenId      = caoZuoRenId;
                xiaoXiInfo.FaChuTime       = DateTime.Now;
                xiaoXiInfo.GuanLianId      = string.Empty;
                xiaoXiInfo.JieShouGongSiId = string.Empty;
                xiaoXiInfo.JieShouRenId    = string.Empty;
                xiaoXiInfo.LeiXing         = EyouSoft.Model.XiaoXiLeiXing.供应商待报价;
                xiaoXiInfo.NeiRong         = "您有一个采购单需要报价";
                xiaoXiInfo.Status          = EyouSoft.Model.XiaoXiStatus.未读;
                xiaoXiInfo.XiaoXiId        = string.Empty;

                var caiGouDingDanItems = new EyouSoft.BLL.BDingDan().GetDingDans(caiGouDanId);
                if (caiGouDingDanItems != null && caiGouDingDanItems.Count > 0)
                {
                    foreach (var item in caiGouDingDanItems)
                    {
                        xiaoXiInfo.GuanLianId      = item.DingDanId;
                        xiaoXiInfo.JieShouGongSiId = item.GysId;
                        xiaoXiInfo.NeiRong         = "您有一个采购单需要报价,采购单号:" + item.CaiGouDanHao + "。";

                        BXiaoXi.XiaoXi_C(xiaoXiInfo);
                    }
                }
            }
            #endregion

            if (dalRetCode == 1)
            {
                var logInfo = new EyouSoft.Model.MCaoZuoLogInfo();
                logInfo.BiaoTi     = "发布采购信息";
                logInfo.NeiRong    = "发布采购信息,采购单编号:" + caiGouDanId + "。";
                logInfo.GuanLianId = caiGouDanId;
                BCaoZuoLog.Log_C(logInfo);
            }
            return(dalRetCode);
        }
Exemplo n.º 7
0
        /// <summary>
        /// 设置默认地址,返回1成功,其它失败
        /// </summary>
        /// <param name="gongSiId">公司编号</param>
        /// <param name="diZhiId">地址编号</param>
        /// <returns></returns>
        public int SheZhiMoRen(string gongSiId, string diZhiId)
        {
            int dalRetCode = dal.SheZhiMoRen(gongSiId, diZhiId);

            if (dalRetCode == 1)
            {
                var logInfo = new EyouSoft.Model.MCaoZuoLogInfo();
                logInfo.BiaoTi     = "设置默认地址";
                logInfo.NeiRong    = "设置默认地址,地址编号:" + diZhiId + "。";
                logInfo.GuanLianId = diZhiId;
                BCaoZuoLog.Log_C(logInfo);
            }
            return(dalRetCode);
        }
Exemplo n.º 8
0
        /// <summary>
        /// 采购商、供应商信息修改,返回1成功,其它失败
        /// </summary>
        /// <param name="info">实体</param>
        /// <returns></returns>
        public int GongSi_U(EyouSoft.Model.MGongSiInfo info)
        {
            if (info == null || string.IsNullOrEmpty(info.Name) || string.IsNullOrEmpty(info.GongSiId) || string.IsNullOrEmpty(info.CaoZuoRenId))
            {
                return(0);
            }
            info.IssueTime = DateTime.Now;
            int dalRetCode = dal.GongSi_CU(info);

            if (dalRetCode == 1)
            {
                var logInfo = new EyouSoft.Model.MCaoZuoLogInfo();
                logInfo.BiaoTi     = "修改公司信息";
                logInfo.NeiRong    = "修改公司信息,公司编号:" + info.GongSiId + "。";
                logInfo.GuanLianId = info.GongSiId;
                BCaoZuoLog.Log_C(logInfo);
            }

            #region 消息处理
            if (dalRetCode == 1 &&
                info.ShenHeStatus == EyouSoft.Model.ShenHeStatus.未审核 &&
                !string.IsNullOrEmpty(info.YingYeZhiZhaoFilepath) &&
                !string.IsNullOrEmpty(info.ZuZhiJiGouFilepath))
            {
                var xiaoXiInfo = new EyouSoft.Model.MXiaoXiInfo();
                xiaoXiInfo.BiaoTi          = "公司注册待审核";
                xiaoXiInfo.ChuLiRenId      = string.Empty;
                xiaoXiInfo.ChuLiTime       = null;
                xiaoXiInfo.FaChuGongSiId   = info.GongSiId;
                xiaoXiInfo.FaChuRenId      = info.CaoZuoRenId;
                xiaoXiInfo.FaChuTime       = DateTime.Now;
                xiaoXiInfo.GuanLianId      = info.GongSiId;
                xiaoXiInfo.JieShouGongSiId = EyouSoft.Model.MGongSiInfo.PingTaiGongSiId;
                xiaoXiInfo.JieShouRenId    = string.Empty;
                xiaoXiInfo.LeiXing         = EyouSoft.Model.XiaoXiLeiXing.公司注册待审核;
                xiaoXiInfo.NeiRong         = "您有一个注册公司信息需要审核,公司名称:" + info.Name + "。";
                xiaoXiInfo.Status          = EyouSoft.Model.XiaoXiStatus.未读;
                xiaoXiInfo.XiaoXiId        = string.Empty;

                BXiaoXi.XiaoXi_C(xiaoXiInfo);
            }
            #endregion

            return(dalRetCode);
        }
Exemplo n.º 9
0
        /// <summary>
        /// 获取操作日志信息集合
        /// </summary>
        /// <param name="pageSize">页记录数</param>
        /// <param name="pageIndex">页序号</param>
        /// <param name="recordCount">总记录数</param>
        /// <param name="chaXun">查询</param>
        /// <returns></returns>
        public IList <EyouSoft.Model.MCaoZuoLogInfo> GetLogs(int pageSize, int pageIndex, ref int recordCount, EyouSoft.Model.MCaoZuoLogChaXunInfo chaXun)
        {
            IList <EyouSoft.Model.MCaoZuoLogInfo> items = new List <EyouSoft.Model.MCaoZuoLogInfo>();

            string        fields        = "*,(SELECT A1.Name FROM tbl_YongHu AS A1 WHERE A1.YongHuId=tbl_CaoZuoLog.CaoZuoRenId) AS CaoZuoRenName";
            StringBuilder sql           = new StringBuilder();
            string        tableName     = "tbl_CaoZuoLog";
            string        orderByString = " IssueTime DESC ";
            string        heJiString    = "";

            #region sql
            sql.Append(" 1=1 ");

            if (chaXun != null)
            {
                if (!string.IsNullOrEmpty(chaXun.GongSiId))
                {
                    sql.AppendFormat(" AND GongSiId='{0}' ", chaXun.GongSiId);
                }
            }

            #endregion

            using (IDataReader rdr = DbHelper.ExecuteReader1(_db, pageSize, pageIndex, ref recordCount, tableName, fields, sql.ToString(), orderByString, heJiString))
            {
                while (rdr.Read())
                {
                    var info = new EyouSoft.Model.MCaoZuoLogInfo();
                    info.BiaoTi        = rdr["BiaoTi"].ToString();
                    info.CaoZuoRenId   = rdr["CaoZuoRenId"].ToString();
                    info.CaoZuoRenName = rdr["CaoZuoRenName"].ToString();
                    info.GongSiId      = rdr["GongSiId"].ToString();
                    info.GuanLianId    = rdr["GuanLianId"].ToString();
                    info.IP            = rdr["IP"].ToString();
                    info.IssueTime     = rdr.GetDateTime(rdr.GetOrdinal("IssueTime"));
                    info.LeiXing       = (EyouSoft.Model.CaoZuoLogLeiXing)rdr.GetInt32(rdr.GetOrdinal("LeiXing"));
                    info.LogId         = rdr["LogId"].ToString();
                    info.NeiRong       = rdr["NeiRong"].ToString();

                    items.Add(info);
                }
            }

            return(items);
        }
Exemplo n.º 10
0
        /// <summary>
        /// 采购商、供应商信息删除,返回1成功,其它失败
        /// </summary>
        /// <param name="gongSiId">采购商、供应商公司编号</param>
        /// <returns></returns>
        public int GongSi_D(string gongSiId)
        {
            if (string.IsNullOrEmpty(gongSiId))
            {
                return(0);
            }
            int dalRetCode = dal.GongSi_D(gongSiId);

            if (dalRetCode == 1)
            {
                var logInfo = new EyouSoft.Model.MCaoZuoLogInfo();
                logInfo.BiaoTi     = "删除公司信息";
                logInfo.NeiRong    = "删除公司信息,公司编号:" + gongSiId + "。";
                logInfo.GuanLianId = gongSiId;
                BCaoZuoLog.Log_C(logInfo);
            }
            return(dalRetCode);
        }
Exemplo n.º 11
0
        /// <summary>
        /// 设置采购商默认模板,返回1成功,其它失败
        /// </summary>
        /// <param name="cgsId">采购商编号</param>
        /// <param name="moBanId">模板编号</param>
        /// <returns></returns>
        public int SheZhiMoRenMoBan(string cgsId, string moBanId)
        {
            if (string.IsNullOrEmpty(cgsId) || string.IsNullOrEmpty(moBanId))
            {
                return(0);
            }
            int dalRetCode = dal.SheZhiMoRenMoBan(cgsId, moBanId);

            if (dalRetCode == 1)
            {
                var logInfo = new EyouSoft.Model.MCaoZuoLogInfo();
                logInfo.BiaoTi     = "设置默认采购模板";
                logInfo.NeiRong    = "设置默认采购模板,模板编号:" + moBanId + "。";
                logInfo.GuanLianId = moBanId;
                BCaoZuoLog.Log_C(logInfo);
            }
            return(dalRetCode);
        }
Exemplo n.º 12
0
        /// <summary>
        /// 操作日志添加,返回1成功,其它失败
        /// </summary>
        /// <param name="info">实体</param>
        /// <returns></returns>
        public int Log_C(EyouSoft.Model.MCaoZuoLogInfo info)
        {
            var cmd = _db.GetSqlStringCommand("INSERT INTO [tbl_CaoZuoLog]([LogId],[GongSiId],[CaoZuoRenId],[LeiXing],[BiaoTi],[NeiRong],[IssueTime],[IP],[GuanLianId]) VALUES(@LogId,@GongSiId,@CaoZuoRenId,@LeiXing,@BiaoTi,@NeiRong,@IssueTime,@IP,@GuanLianId)");

            _db.AddInParameter(cmd, "@LogId", DbType.AnsiStringFixedLength, info.LogId);
            _db.AddInParameter(cmd, "@GongSiId", DbType.AnsiStringFixedLength, info.GongSiId);
            _db.AddInParameter(cmd, "@CaoZuoRenId", DbType.AnsiStringFixedLength, info.CaoZuoRenId);
            _db.AddInParameter(cmd, "@LeiXing", DbType.Int32, info.LeiXing);
            _db.AddInParameter(cmd, "@BiaoTi", DbType.String, info.BiaoTi);
            _db.AddInParameter(cmd, "@NeiRong", DbType.String, info.NeiRong);
            _db.AddInParameter(cmd, "@IssueTime", DbType.DateTime, info.IssueTime);
            _db.AddInParameter(cmd, "@IP", DbType.String, info.IP);
            _db.AddInParameter(cmd, "@GuanLianId", DbType.AnsiStringFixedLength, info.GuanLianId);


            DbHelper.ExecuteSql(cmd, _db);
            return(1);
        }
Exemplo n.º 13
0
        /// <summary>
        /// 禁用用户,返回1成功,其它失败
        /// </summary>
        /// <param name="gongSiId">公司编号</param>
        /// <param name="yongHuId">用户编号</param>
        /// <returns></returns>
        public int JinYong(string gongSiId, string yongHuId)
        {
            if (string.IsNullOrEmpty(gongSiId) || string.IsNullOrEmpty(yongHuId))
            {
                return(0);
            }
            int dalRetCode = dal.SheZhiStatus(gongSiId, yongHuId, EyouSoft.Model.YongHuStatus.禁用);

            if (dalRetCode == 1)
            {
                var logInfo = new EyouSoft.Model.MCaoZuoLogInfo();
                logInfo.BiaoTi     = "禁用用户";
                logInfo.NeiRong    = "禁用用户,用户编号:" + yongHuId + "。";
                logInfo.GuanLianId = yongHuId;
                BCaoZuoLog.Log_C(logInfo);
            }
            return(dalRetCode);
        }
Exemplo n.º 14
0
        /// <summary>
        /// 设置角色状态
        /// </summary>
        /// <param name="jueSeId">角色编号</param>
        /// <param name="status">角色状态</param>
        /// <returns></returns>
        public int SheZhiStatus(string jueSeId, EyouSoft.Model.YongHuJueSeStatus status)
        {
            if (string.IsNullOrEmpty(jueSeId))
            {
                return(0);
            }
            int dalRetCode = dal.SheZhiStatus(jueSeId, status);

            if (dalRetCode == 1)
            {
                var logInfo = new EyouSoft.Model.MCaoZuoLogInfo();
                logInfo.BiaoTi     = "设置用户角色状态";
                logInfo.NeiRong    = "设置用户角色状态,角色编号:" + jueSeId + ",角色状态:" + status + "。";
                logInfo.GuanLianId = jueSeId;
                BCaoZuoLog.Log_C(logInfo);
            }
            return(dalRetCode);
        }
Exemplo n.º 15
0
        /// <summary>
        /// 用户角色删除,返回1成功,其它失败
        /// </summary>
        /// <param name="gongSiId">公司编号</param>
        /// <param name="jueSeId">角色编号</param>
        /// <returns></returns>
        public int JueSe_D(string gongSiId, string jueSeId)
        {
            if (string.IsNullOrEmpty(gongSiId) || string.IsNullOrEmpty(jueSeId))
            {
                return(0);
            }
            int dalRetCode = dal.JueSe_D(gongSiId, jueSeId);

            if (dalRetCode == 1)
            {
                var logInfo = new EyouSoft.Model.MCaoZuoLogInfo();
                logInfo.BiaoTi     = "删除用户角色";
                logInfo.NeiRong    = "删除用户角色,角色编号:" + jueSeId + "。";
                logInfo.GuanLianId = jueSeId;
                BCaoZuoLog.Log_C(logInfo);
            }
            return(dalRetCode);
        }
Exemplo n.º 16
0
        /// <summary>
        /// 产品删除,返回1成功,其它失败
        /// </summary>
        /// <param name="gysId">供应商编号</param>
        /// <param name="chanPinId">产品编号</param>
        /// <returns></returns>
        public int ChanPin_D(string gysId, string chanPinId)
        {
            if (string.IsNullOrEmpty(gysId) || string.IsNullOrEmpty(chanPinId))
            {
                return(0);
            }
            int dalRetCode = dal.ChanPin_D(gysId, chanPinId);

            if (dalRetCode == 1)
            {
                var logInfo = new EyouSoft.Model.MCaoZuoLogInfo();
                logInfo.BiaoTi     = "删除产品信息";
                logInfo.NeiRong    = "删除产品信息,产品编号:" + chanPinId + "。";
                logInfo.GuanLianId = chanPinId;
                BCaoZuoLog.Log_C(logInfo);
            }
            return(dalRetCode);
        }
Exemplo n.º 17
0
        /// <summary>
        /// 采购单删除,返回1成功,其它失败
        /// </summary>
        /// <param name="cgsId">采购商编号</param>
        /// <param name="caiGouDanId">采购单编号</param>
        /// <returns></returns>
        public int CaiGouDan_D(string cgsId, string caiGouDanId)
        {
            if (string.IsNullOrEmpty(cgsId) || string.IsNullOrEmpty(caiGouDanId))
            {
                return(0);
            }

            int dalRetCode = dal.CaiGouDan_D(cgsId, caiGouDanId);

            if (dalRetCode == 1)
            {
                var logInfo = new EyouSoft.Model.MCaoZuoLogInfo();
                logInfo.BiaoTi     = "删除采购单";
                logInfo.NeiRong    = "删除采购单,采购单编号:" + caiGouDanId + "。";
                logInfo.GuanLianId = caiGouDanId;
                BCaoZuoLog.Log_C(logInfo);
            }
            return(dalRetCode);
        }
Exemplo n.º 18
0
        /// <summary>
        /// 采购商、供应商、平台用户信息删除,返回1成功,其它失败
        /// </summary>
        /// <param name="gongSiId">采购商、供应商编号</param>
        /// <param name="yongHuId">用户编号</param>
        /// <returns></returns>
        public int YongHu_D(string gongSiId, string yongHuId)
        {
            if (string.IsNullOrEmpty(yongHuId))
            {
                return(0);
            }

            int dalRetCode = dal.YongHu_D(gongSiId, yongHuId);

            if (dalRetCode == 1)
            {
                var logInfo = new EyouSoft.Model.MCaoZuoLogInfo();
                logInfo.BiaoTi     = "删除用户信息";
                logInfo.NeiRong    = "删除用户信息,用户编号:" + yongHuId + "。";
                logInfo.GuanLianId = yongHuId;
                BCaoZuoLog.Log_C(logInfo);
            }
            return(dalRetCode);
        }
Exemplo n.º 19
0
        /// <summary>
        /// 删除公司关系,返回1成功,其它失败
        /// </summary>
        /// <param name="gongSiId1">公司编号1</param>
        /// <param name="gongSiId2">公司编号2</param>
        /// <returns></returns>
        public int GuanXi_D(string gongSiId1, string gongSiId2)
        {
            if (string.IsNullOrEmpty(gongSiId1) ||
                string.IsNullOrEmpty(gongSiId2))
            {
                return(0);
            }
            int dalRetCode = dal.GuanXi_D(gongSiId1, gongSiId2);

            if (dalRetCode == 1)
            {
                var logInfo = new EyouSoft.Model.MCaoZuoLogInfo();
                logInfo.BiaoTi     = "删除公司关系";
                logInfo.NeiRong    = "删除公司关系,对方公司编号:" + gongSiId2 + "。";
                logInfo.GuanLianId = string.Empty;
                BCaoZuoLog.Log_C(logInfo);
            }
            return(dalRetCode);
        }
Exemplo n.º 20
0
        /// <summary>
        /// 地址删除,返回1成功,其它失败
        /// </summary>
        /// <param name="gongSiId">公司编号</param>
        /// <param name="diZhiId">地址编号</param>
        /// <returns></returns>
        public int DiZhi_D(string gongSiId, string diZhiId)
        {
            if (string.IsNullOrEmpty(gongSiId) ||
                string.IsNullOrEmpty(diZhiId))
            {
                return(0);
            }

            var dalRetCode = dal.DiZhi_D(gongSiId, diZhiId);

            if (dalRetCode == 1)
            {
                var logInfo = new EyouSoft.Model.MCaoZuoLogInfo();
                logInfo.BiaoTi     = "删除地址";
                logInfo.NeiRong    = "删除地址,地址编号:" + diZhiId + "。";
                logInfo.GuanLianId = diZhiId;
                BCaoZuoLog.Log_C(logInfo);
            }
            return(dalRetCode);
        }
Exemplo n.º 21
0
        /// <summary>
        /// 设置采购商付款状态,返回1成功,其它失败
        /// </summary>
        /// <param name="cgsId">采购商编号</param>
        /// <param name="dingDanId">订单编号</param>
        /// <param name="status">付款状态</param>
        /// <param name="caoZuoRenId">操作人编号</param>
        /// <returns></returns>
        public int SheZhiCgsFuKuanStatus(string cgsId, string dingDanId, EyouSoft.Model.FuKuanStatus status, string caoZuoRenId)
        {
            if (string.IsNullOrEmpty(cgsId) || string.IsNullOrEmpty(dingDanId) || string.IsNullOrEmpty(caoZuoRenId))
            {
                return(0);
            }

            int dalRetCode = dal.SheZhiCgsFuKuanStatus(cgsId, dingDanId, status, caoZuoRenId, DateTime.Now);

            if (dalRetCode == 1)
            {
                var logInfo = new EyouSoft.Model.MCaoZuoLogInfo();
                logInfo.BiaoTi     = "采购商设置付款状态";
                logInfo.NeiRong    = "采购商设置付款状态,订单编号:" + dingDanId + ",付款状态:" + status + "。";
                logInfo.GuanLianId = dingDanId;
                BCaoZuoLog.Log_C(logInfo);
            }

            return(dalRetCode);
        }
Exemplo n.º 22
0
        /// <summary>
        /// 用户审核,返回1成功,其它失败
        /// </summary>
        /// <param name="gongSiId">公司编号</param>
        /// <param name="yongHuId">用户编号</param>
        /// <param name="shenHeRenId">审核人编号</param>
        /// <returns></returns>
        public int YongHu_ShenHe(string gongSiId, string yongHuId, string shenHeRenId)
        {
            if (string.IsNullOrEmpty(gongSiId)
                //|| string.IsNullOrEmpty(yongHuId)
                || string.IsNullOrEmpty(shenHeRenId))
            {
                return(0);
            }

            int dalRetCode = dal.YongHu_ShenHe(gongSiId, yongHuId, shenHeRenId);

            if (dalRetCode == 1)
            {
                var logInfo = new EyouSoft.Model.MCaoZuoLogInfo();
                logInfo.BiaoTi     = "注册用户审核";
                logInfo.NeiRong    = "注册用户审核,用户编号:" + yongHuId + "。";
                logInfo.GuanLianId = yongHuId;
                BCaoZuoLog.Log_C(logInfo);
            }
            return(dalRetCode);
        }
Exemplo n.º 23
0
        /// <summary>
        /// 采购商、供应商信息添加,返回1成功,其它失败
        /// </summary>
        /// <param name="info">实体</param>
        /// <returns></returns>
        public int GongSi_C(EyouSoft.Model.MGongSiInfo info)
        {
            if (info == null || string.IsNullOrEmpty(info.Name) || string.IsNullOrEmpty(info.CaoZuoRenId))
            {
                return(0);
            }

            info.GongSiId  = Guid.NewGuid().ToString();
            info.IssueTime = DateTime.Now;

            int dalRetCode = dal.GongSi_CU(info);

            if (dalRetCode == 1)
            {
                var logInfo = new EyouSoft.Model.MCaoZuoLogInfo();
                logInfo.BiaoTi     = "添加公司信息";
                logInfo.NeiRong    = "添加公司信息,公司编号:" + info.GongSiId + ",公司类型:" + info.LeiXing + "。";
                logInfo.GuanLianId = info.GongSiId;
                BCaoZuoLog.Log_C(logInfo);
            }
            return(dalRetCode);
        }
Exemplo n.º 24
0
        /// <summary>
        /// 添加操作日志,返回1成功,其它失败
        /// </summary>
        /// <param name="info">实体</param>
        /// <returns></returns>
        internal static int Log_C(EyouSoft.Model.MCaoZuoLogInfo info)
        {
            if (info == null)
            {
                return(0);
            }

            var loginYongHuInfo = EyouSoft.Security.Membership.YongHuProvider.GetYongHuInfo();

            if (loginYongHuInfo != null)
            {
                info.GongSiId    = loginYongHuInfo.GongSiId;
                info.CaoZuoRenId = loginYongHuInfo.YongHuId;
            }
            info.IP = EyouSoft.Toolkit.Utils.GetRemoteIP();

            info.LogId     = Guid.NewGuid().ToString();
            info.IssueTime = DateTime.Now;

            int dalRetCode = new EyouSoft.DAL.DCaoZuoLog().Log_C(info);

            return(dalRetCode);
        }
Exemplo n.º 25
0
        /// <summary>
        /// 用户角色添加,返回1成功,其它失败
        /// </summary>
        /// <param name="info">实体</param>
        /// <returns></returns>
        public int JueSe_C(EyouSoft.Model.MYongHuJueSeInfo info)
        {
            if (info == null ||
                string.IsNullOrEmpty(info.GongSiId) ||
                string.IsNullOrEmpty(info.CaoZuoRenId) ||
                string.IsNullOrEmpty(info.Name))
            {
                return(0);
            }
            info.JueSeId   = Guid.NewGuid().ToString();
            info.IssueTime = DateTime.Now;
            int dalRetCode = dal.JueSe_C(info);

            if (dalRetCode == 1)
            {
                var logInfo = new EyouSoft.Model.MCaoZuoLogInfo();
                logInfo.BiaoTi     = "添加用户角色";
                logInfo.NeiRong    = "添加用户角色,用户编号:" + info.JueSeId + "。";
                logInfo.GuanLianId = info.JueSeId;
                BCaoZuoLog.Log_C(logInfo);
            }
            return(dalRetCode);
        }
Exemplo n.º 26
0
        /// <summary>
        /// 地址修改,返回1成功,其它失败
        /// </summary>
        /// <param name="info">实体</param>
        /// <returns></returns>
        public int DiZhi_U(EyouSoft.Model.MDiZhiInfo info)
        {
            if (info == null ||
                string.IsNullOrEmpty(info.CaoZuoRenId) ||
                string.IsNullOrEmpty(info.Name) ||
                string.IsNullOrEmpty(info.DiZhiId))
            {
                return(0);
            }

            info.IssueTime = DateTime.Now;

            var dalRetCode = dal.DiZhi_U(info);

            if (dalRetCode == 1)
            {
                var logInfo = new EyouSoft.Model.MCaoZuoLogInfo();
                logInfo.BiaoTi     = "修改地址";
                logInfo.NeiRong    = "修改地址,地址编号:" + info.DiZhiId + "。";
                logInfo.GuanLianId = info.DiZhiId;
                BCaoZuoLog.Log_C(logInfo);
            }
            return(dalRetCode);
        }
Exemplo n.º 27
0
        /// <summary>
        /// 产品价格新增,返回1成功,其它失败
        /// </summary>
        /// <param name="info">实体</param>
        /// <returns></returns>
        public int ChanPinJiaGe_C(EyouSoft.Model.MChanPinJiaGeInfo info)
        {
            if (info == null ||
                string.IsNullOrEmpty(info.CaoZuoRenId) ||
                string.IsNullOrEmpty(info.ChanPinId))
            {
                return(0);
            }

            info.JiaGeId   = Guid.NewGuid().ToString();
            info.IssueTime = DateTime.Now;

            int dalRetCode = dal.ChanPinJiaGe_C(info);

            if (dalRetCode == 1)
            {
                var logInfo = new EyouSoft.Model.MCaoZuoLogInfo();
                logInfo.BiaoTi     = "维护产品价格";
                logInfo.NeiRong    = "维护产品价格,价格编号:" + info.JiaGeId + "。";
                logInfo.GuanLianId = info.JiaGeId;
                BCaoZuoLog.Log_C(logInfo);
            }
            return(dalRetCode);
        }
Exemplo n.º 28
0
        /// <summary>
        /// 采购单添加,返回1成功,其它失败
        /// </summary>
        /// <param name="info">实体</param>
        /// <returns></returns>
        public int CaiGouDan_C(EyouSoft.Model.MCaiGouDanInfo info)
        {
            if (info == null ||
                string.IsNullOrEmpty(info.CgsId) ||
                string.IsNullOrEmpty(info.CaiGouDanName) ||
                string.IsNullOrEmpty(info.CaoZuoRenId))
            {
                return(0);
            }
            if (info.ChanPins == null || info.ChanPins.Count == 0)
            {
                return(0);
            }

            info.CaiGouDanId = Guid.NewGuid().ToString();
            info.IssueTime   = DateTime.Now;

            List <EyouSoft.Model.MDingDanInfo> dingDans = new List <EyouSoft.Model.MDingDanInfo>();

            foreach (var item in info.ChanPins)
            {
                if (string.IsNullOrEmpty(item.GysId) || string.IsNullOrEmpty(item.ChanPinId))
                {
                    continue;
                }
                var item1 = dingDans.Find(temp => { if (temp.GysId == item.GysId)
                                                    {
                                                        return(true);
                                                    }
                                                    else
                                                    {
                                                        return(false);
                                                    } });
                item1 = item1 ?? new EyouSoft.Model.MDingDanInfo();

                if (string.IsNullOrEmpty(item1.DingDanId))
                {
                    item1.DingDanId = Guid.NewGuid().ToString();
                    item1.GysId     = item.GysId;
                    item1.ChanPins  = new List <EyouSoft.Model.MDingDanChanPinInfo>();
                    item1.Status    = EyouSoft.Model.DingDanStatus.计划采购;
                    item1.JinE      = 0;

                    dingDans.Add(item1);
                }

                var item2 = new EyouSoft.Model.MDingDanChanPinInfo();
                item2.MingXiId  = Guid.NewGuid().ToString();
                item2.ChanPinId = item.ChanPinId;
                item2.ShuLiang  = item.ShuLiang;

                item1.ChanPins.Add(item2);
            }

            if (dingDans == null || dingDans.Count == 0)
            {
                return(0);
            }

            int dalRetCode = dal.CaiGouDan_CU(info, dingDans);

            if (dalRetCode == 1)
            {
                var logInfo = new EyouSoft.Model.MCaoZuoLogInfo();
                logInfo.BiaoTi     = "添加采购单";
                logInfo.NeiRong    = "添加采购单,采购单编号:" + info.CaiGouDanId + "。";
                logInfo.GuanLianId = info.CaiGouDanId;
                BCaoZuoLog.Log_C(logInfo);
            }

            return(dalRetCode);
        }
Exemplo n.º 29
0
        /// <summary>
        /// 设置订单状态,返回1成功,其它失败
        /// </summary>
        /// <param name="dingDanId">订单编号</param>
        /// <param name="status">订单状态</param>
        /// <param name="caoZuoRenId">操作人编号</param>
        /// <returns></returns>
        public int SheZhiStatus(string dingDanId, EyouSoft.Model.DingDanStatus status, string caoZuoRenId)
        {
            if (string.IsNullOrEmpty(dingDanId) || string.IsNullOrEmpty(caoZuoRenId))
            {
                return(0);
            }

            var info = GetInfo(dingDanId);

            if (info == null)
            {
                return(-1);
            }
            if (info.Status == EyouSoft.Model.DingDanStatus.计划采购)
            {
                return(-2);
            }
            var buKeQuXiaoStatus = new[] { EyouSoft.Model.DingDanStatus.供应商发货完成, EyouSoft.Model.DingDanStatus.采购商确认收货 };

            if (status == EyouSoft.Model.DingDanStatus.取消采购 && buKeQuXiaoStatus.Contains(info.Status))
            {
                return(-3);
            }

            int dalRetCode = dal.SheZhiStatus(dingDanId, status, caoZuoRenId, DateTime.Now);

            #region 消息处理
            if (dalRetCode == 1)
            {
                var xiaoXiInfo = new EyouSoft.Model.MXiaoXiInfo();

                xiaoXiInfo.BiaoTi          = string.Empty;
                xiaoXiInfo.ChuLiRenId      = string.Empty;
                xiaoXiInfo.ChuLiTime       = null;
                xiaoXiInfo.FaChuGongSiId   = string.Empty;
                xiaoXiInfo.FaChuRenId      = caoZuoRenId;
                xiaoXiInfo.FaChuTime       = DateTime.Now;
                xiaoXiInfo.GuanLianId      = dingDanId;
                xiaoXiInfo.JieShouGongSiId = string.Empty;
                xiaoXiInfo.JieShouRenId    = string.Empty;
                xiaoXiInfo.LeiXing         = EyouSoft.Model.XiaoXiLeiXing.None;
                xiaoXiInfo.NeiRong         = string.Empty;
                xiaoXiInfo.Status          = EyouSoft.Model.XiaoXiStatus.未读;
                xiaoXiInfo.XiaoXiId        = string.Empty;

                if (status == EyouSoft.Model.DingDanStatus.供应商完成报价)
                {
                    xiaoXiInfo.BiaoTi          = "待确认报价";
                    xiaoXiInfo.FaChuGongSiId   = info.GysId;
                    xiaoXiInfo.JieShouGongSiId = info.CgsId;
                    xiaoXiInfo.LeiXing         = EyouSoft.Model.XiaoXiLeiXing.采购商待确认报价;
                    xiaoXiInfo.NeiRong         = "您有一个采购单报价信息需要确认,采购单号:" + info.CaiGouDanHao + "。";
                }

                if (status == EyouSoft.Model.DingDanStatus.采购商确认报价)
                {
                    xiaoXiInfo.BiaoTi          = "待发货";
                    xiaoXiInfo.FaChuGongSiId   = info.CgsId;
                    xiaoXiInfo.JieShouGongSiId = info.GysId;
                    xiaoXiInfo.LeiXing         = EyouSoft.Model.XiaoXiLeiXing.供应商待发货;
                    xiaoXiInfo.NeiRong         = "您有一个采购单需要发货,采购单号:" + info.CaiGouDanHao + "。";
                }

                if (status == EyouSoft.Model.DingDanStatus.供应商发货完成)
                {
                    xiaoXiInfo.BiaoTi          = "待收货";
                    xiaoXiInfo.FaChuGongSiId   = info.GysId;
                    xiaoXiInfo.JieShouGongSiId = info.CgsId;
                    xiaoXiInfo.LeiXing         = EyouSoft.Model.XiaoXiLeiXing.采购商待确认收货;
                    xiaoXiInfo.NeiRong         = "您有一个采购单供应商已发货,待收货确认,采购单号:" + info.CaiGouDanHao + "。";
                }

                BXiaoXi.XiaoXi_C(xiaoXiInfo);
            }
            #endregion

            if (dalRetCode == 1)
            {
                var logInfo = new EyouSoft.Model.MCaoZuoLogInfo();
                logInfo.BiaoTi     = "设置订单状态";
                logInfo.NeiRong    = "设置订单状态,订单编号:" + info.DingDanId + ",订单状态:" + status + "。";
                logInfo.GuanLianId = info.DingDanId;
                BCaoZuoLog.Log_C(logInfo);
            }
            return(dalRetCode);
        }