当前位置: 首页>>代码示例>>C#>>正文


C# CM_ClientBLL.GetSupplierInfo方法代码示例

本文整理汇总了C#中CM_ClientBLL.GetSupplierInfo方法的典型用法代码示例。如果您正苦于以下问题:C# CM_ClientBLL.GetSupplierInfo方法的具体用法?C# CM_ClientBLL.GetSupplierInfo怎么用?C# CM_ClientBLL.GetSupplierInfo使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在CM_ClientBLL的用法示例。


在下文中一共展示了CM_ClientBLL.GetSupplierInfo方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: RetailerUpdate

        /// <summary>
        /// 新增门店资料
        /// </summary>
        /// <param name="User">用户</param>
        /// <param name="TDP"></param>
        /// <param name="ClientJson">门店资料Json</param>
        /// <returns>大于0:新增的门店ID -1:Json字符串无法解析 -2:所属经销商无效 -3:更新门店基本资料失败</returns>
        public static int RetailerUpdate(UserInfo User, int TDP, ClientInfo Client, out string ErrorInfo)
        {
            ErrorInfo = "";
            LogWriter.WriteLog("PBMIFService.RetailerUpdate:UserName=" + User.UserName + ",TDP=" + TDP.ToString()
                + ",ClientInfo=" + JsonConvert.SerializeObject(Client));
            if (User.OwnerType == 3) TDP = User.ClientID;

            try
            {
                ClientInfo c = Client;
                if (c == null) { ErrorInfo = "Json字符串无法解析"; return -1; }        //Json字符串无法解析

                CM_Client TDPClient = new CM_ClientBLL(TDP).Model;
                if (TDPClient == null) { ErrorInfo = "所属经销商无效"; return -2; }   //所属经销商无效

                #region 判断必填与重复检测
                if (c.FullName == "") { ErrorInfo = "门店名称必填"; return -10; }
                if (c.Mobile == "") { ErrorInfo = "联系电话必填"; return -10; }
                if (c.Address == "") { ErrorInfo = "门店地址必填"; return -10; }

                if (c.Mobile.StartsWith("01")) c.Mobile = c.Mobile.Substring(1);
                if (c.TeleNum.Contains("-")) c.TeleNum = c.TeleNum.Replace("-", "");
                if (c.Mobile.Contains("-")) c.Mobile = c.Mobile.Replace("-", "");

                //检查门店资料重复
                int rptclientid = CM_ClientBLL.CheckRepeat(TDP, Client.ID, c.Mobile, c.TeleNum, c.FullName, c.Address);
                if (rptclientid > 0)
                {
                    CM_Client _rptclient = new CM_ClientBLL(rptclientid).Model;
                    ErrorInfo = "门店资料与[" + _rptclient.FullName + "]资料重复,请勿重复新增!";
                    return -11;
                }
                #endregion

                CM_ClientBLL bll = new CM_ClientBLL(c.ID);

                #region 门店基本资料
                bll.Model.Code = c.Code;
                bll.Model.FullName = c.FullName != "" ? c.FullName : c.ShortName;
                bll.Model.ShortName = c.ShortName == "" ? c.FullName : c.ShortName;

                if (c.OfficialCity > 0)
                    bll.Model.OfficialCity = c.OfficialCity;
                else
                    bll.Model.OfficialCity = TDPClient.OfficialCity;

                if (bll.Model.DeliveryAddress == bll.Model.Address)
                    bll.Model.DeliveryAddress = c.Address;
                bll.Model.Address = c.Address;

                bll.Model.LinkManName = c.LinkManName;
                bll.Model.TeleNum = c.TeleNum == "" ? c.Mobile : c.TeleNum;
                if (c.Mobile.StartsWith("1") && c.Mobile.Length == 11) bll.Model.Mobile = c.Mobile;
                bll.Model.UpdateStaff = User.StaffID;
                #endregion

                int retailerid = bll.Update();
                if (retailerid < 0) return -3;      //更新门店基本资料失败

                #region 设置供货商信息
                CM_ClientSupplierInfo supplierinfo = bll.GetSupplierInfo(TDP);
                supplierinfo.Code = c.CodeBySupplier;
                supplierinfo.StandardPrice = c.StandardPrice;
                supplierinfo.TDPChannel = c.TDPChannel;
                supplierinfo.TDPSalesArea = c.TDPSalesArea;
                supplierinfo.VisitRoute = c.VisitRoute;
                supplierinfo.VisitSequence = c.VisitSequence;
                supplierinfo.VisitTemplate = c.VisitTemplate;
                supplierinfo.UpdateStaff = User.StaffID;
                bll.SetSupplierInfo(supplierinfo);
                #endregion

                #region 设置厂商管理信息
                #endregion

                return 0;
            }
            catch (System.Exception err)
            {
                LogWriter.WriteLog("PBMIFService.RetailerAdd Exception Error!", err);
                return -100;
            }
        }
开发者ID:fuhongliang,项目名称:GraduateProject,代码行数:90,代码来源:PBMService.cs

示例2: DoImportClient


//.........这里部分代码省略.........
                    string _strSalesArea = dr["区域"].ToString();
                    if (!string.IsNullOrEmpty(_strSalesArea))
                    {
                        IList<CM_RTSalesArea_TDP> _listSalesArea = CM_RTSalesArea_TDPBLL.GetModelList(" OwnerClient= " + _OwnerClient.ToString() + " AND Name='" + _strSalesArea + "' ");
                        if (_listSalesArea != null && _listSalesArea.Count > 0) _SalesArea = _listSalesArea[0].ID;
                        else
                        {
                            CM_RTSalesArea_TDPBLL _bllRTSalesArea_TDPBLL = new CM_RTSalesArea_TDPBLL();
                            _bllRTSalesArea_TDPBLL.Model.Name = _strSalesArea;
                            _bllRTSalesArea_TDPBLL.Model.OwnerClient = _OwnerClient;
                            _bllRTSalesArea_TDPBLL.Model.Remark = "Excel批量导入";
                            _bllRTSalesArea_TDPBLL.Model.InsertStaff = _template.Model.InsertStaff;
                            _bllRTSalesArea_TDPBLL.Model.InsertTime = DateTime.Now;
                            _SalesArea = _bllRTSalesArea_TDPBLL.Add();
                        }
                    }
                    #endregion
                    #region 获取所在渠道
                    int _RTChannel = 0;//渠道
                    string _strRTChannel = dr["渠道"].ToString();
                    if (!string.IsNullOrEmpty(_strRTChannel))
                    {
                        IList<CM_RTChannel_TDP> _listRTChannel = CM_RTChannel_TDPBLL.GetModelList(" OwnerClient= " + _OwnerClient.ToString() + " AND Name='" + _strRTChannel + "' ");
                        if (_listRTChannel != null && _listRTChannel.Count > 0) _RTChannel = _listRTChannel[0].ID;
                        else
                        {
                            CM_RTChannel_TDPBLL _bllRTSalesArea_TDPBLL = new CM_RTChannel_TDPBLL();
                            _bllRTSalesArea_TDPBLL.Model.Name = _strRTChannel;
                            _bllRTSalesArea_TDPBLL.Model.OwnerClient = _OwnerClient;
                            _bllRTSalesArea_TDPBLL.Model.Remark = "Excel批量导入";
                            _bllRTSalesArea_TDPBLL.Model.InsertStaff = _template.Model.InsertStaff;
                            _bllRTSalesArea_TDPBLL.Model.InsertTime = DateTime.Now;
                            _RTChannel = _bllRTSalesArea_TDPBLL.Add();
                        }

                    }
                    #endregion

                    CM_ClientBLL _bll = new CM_ClientBLL();//Client表Code字段暂不启用,以FactoryCode作为厂商编码。经销商对门店的编码存于CM_ClientSupplierInfo表的Code字段
                    _bll.Model.FullName = _ClientName;
                    _bll.Model.ShortName = _ClientName;
                    _bll.Model.LinkManName = _ClientLinkMan;
                    _bll.Model.Address = _ClientAddress;
                    _bll.Model.TeleNum = _ClientTel;
                    _bll.Model.Mobile = _ClientMobile;
                    _bll.Model.Remark = string.IsNullOrEmpty(_ClientRemark) ? "Excel批量导入" : _ClientRemark;
                    _bll.Model.ClientType = 3;
                    _bll.Model.ApproveFlag = 1;
                    _bll.Model.InsertStaff = _template.Model.InsertStaff;
                    _bll.Model.OwnerType = 3;           //所属经销商
                    _bll.Model.OwnerClient = _OwnerClient;
                    int _ClientID = _bll.Add();
                    if (_ClientID > 0)
                    {
                        CM_ClientSupplierInfo _Supplierinfo = _bll.GetSupplierInfo(_OwnerClient);
                        if (_Supplierinfo == null)
                        {
                            _Supplierinfo = new CM_ClientSupplierInfo();
                            _Supplierinfo.Supplier = _OwnerClient;
                        }
                        _Supplierinfo.TDPChannel = _RTChannel;
                        _Supplierinfo.TDPSalesArea = _SalesArea;
                        _Supplierinfo.Code = _ClientCode;
                        _Supplierinfo.Remark = _ClientRemark;

                        CM_ClientBLL s = new CM_ClientBLL(_OwnerClient);
                        CM_ClientManufactInfo _manufactinfo = _bll.GetManufactInfo(s.Model.OwnerClient);
                        if (_manufactinfo == null)
                        {
                            _manufactinfo = new CM_ClientManufactInfo();
                            //门店所属区域为经销商对应区域
                            _manufactinfo.Manufacturer = s.Model.OwnerClient;
                            _manufactinfo.OrganizeCity = s.GetManufactInfo().OrganizeCity;
                        }

                        if (_route != null && _route.OwnerType == 3)//线路为经销商级别的存放在经销商表中
                            _Supplierinfo.VisitRoute = _route.ID;
                        else if (_route != null && (_route.OwnerType == 1 || _route.OwnerType == 2))//线路为厂商级别的存放在经销商表中
                            _manufactinfo.VisitRoute = _route.ID;

                        _bll.SetSupplierInfo(_Supplierinfo);
                        _bll.SetManufactInfo(_manufactinfo);
                    }
                }
                catch (Exception ex)
                {
                    ImportInfo += "导入序列号为" + dr["序号"].ToString() + "的数据行时出现错误,错误说明:" + ex.Message + "\r\n";
                    State = 5;
                    continue;
                }
            }
            if (State == 0) State = 3;
            ImportInfo += (State == 3 ? "导入完成!\r\n" : "");
            IPT_UploadTemplateMessageBLL _bllUploadTemplateMessage = new IPT_UploadTemplateMessageBLL();
            _bllUploadTemplateMessage.Model.TemplateID = TemplateID;
            _bllUploadTemplateMessage.Model.MessageType = State;
            _bllUploadTemplateMessage.Model.Content = ImportInfo;
            _bllUploadTemplateMessage.Add();
            return ImportInfo;
        }
开发者ID:fuhongliang,项目名称:GraduateProject,代码行数:101,代码来源:ClientInit.cs

示例3: BindData

    private void BindData()
    {
        CM_ClientBLL _ClientBll = new CM_ClientBLL((int)ViewState["ClientID"]);

        if (_ClientBll.Model == null || _ClientBll.Model.ClientType != 3)
        {
            MessageBox.ShowAndRedirect(this, "请先在‘零售商列表’中选择要查看的零售商!", "RetailerList.aspx?URL=" + Request.Url.PathAndQuery);
            return;
        }

        pl_detail.BindData(_ClientBll.Model);

        CM_ClientSupplierInfo clientSupplierInfo = _ClientBll.GetSupplierInfo((int)Session["OwnerClient"]);
        if (clientSupplierInfo != null) pl_detail.BindData(clientSupplierInfo);

        #region 绑定该客户的首要联系人
        //DropDownList ddl_ChiefLinkMan = (DropDownList)pl_detail.FindControl("CM_Client_ChiefLinkMan");
        //try
        //{
        //    ddl_ChiefLinkMan.DataTextField = "Name";
        //    ddl_ChiefLinkMan.DataValueField = "ID";
        //    ddl_ChiefLinkMan.DataSource = CM_LinkManBLL.GetModelList("ClientID=" + ViewState["ClientID"].ToString());
        //    ddl_ChiefLinkMan.DataBind();
        //    ddl_ChiefLinkMan.Items.Insert(0, new ListItem("请选择", "0"));
        //    ddl_ChiefLinkMan.SelectedValue = m.ChiefLinkMan.ToString();
        //}
        //catch { }

        #endregion

        BindGrid();

        //bt_Map.OnClientClick = "javascript:Pop_MapShow(" + _ClientBll.Model.ID.ToString() + ")";
    }
开发者ID:fuhongliang,项目名称:GraduateProject,代码行数:34,代码来源:RetailerDetail.aspx.cs

示例4: FillClientInfo

        private void FillClientInfo(CM_Client m, int TDP)
        {
            if (m == null) return;

            CM_ClientBLL ClientBLL = new CM_ClientBLL(m.ID);
            if (ClientBLL.Model == null) return;

            #region 绑定基本资料
            ID = m.ID;
            Code = m.Code;
            FullName = m.FullName == "" ? m.ShortName : m.FullName;
            ShortName = m.ShortName;
            OfficialCity = m.OfficialCity;
            Address = m.Address;
            ClientType = m.ClientType;
            LinkManName = m.LinkManName;
            TeleNum = m.TeleNum;
            Mobile = m.Mobile == "" ? m.TeleNum : m.Mobile;

            OfficialCityName = TreeTableBLL.GetFullPathName("MCS_SYS.dbo.Addr_OfficialCity", m.OfficialCity).Replace("->", " ");
            #endregion

            #region 绑定供货信息
            CM_ClientSupplierInfo SupplierInfo = ClientBLL.GetSupplierInfo(TDP);
            if (SupplierInfo != null)
            {
                CodeBySupplier = SupplierInfo.Code;
                Supplier = SupplierInfo.Supplier;
                StandardPrice = SupplierInfo.StandardPrice;
                TDPChannel = SupplierInfo.TDPChannel;
                TDPSalesArea = SupplierInfo.TDPSalesArea;
                VisitRoute = SupplierInfo.VisitRoute;
                VisitSequence = SupplierInfo.VisitSequence;
                VisitTemplate = SupplierInfo.VisitTemplate;

                #region 获取供货商名称
                CM_Client s = new CM_ClientBLL(Supplier).Model;
                if (s != null)
                {
                    SupplierName = s.ShortName == "" ? s.ShortName : s.FullName;
                }
                #endregion

                #region 获取价表名称
                if (StandardPrice != 0)
                {
                    PDT_StandardPrice price = new PDT_StandardPriceBLL(StandardPrice).Model;
                    if (price != null)
                    {
                        StandardPriceName = price.Name;
                    }
                }
                #endregion

                #region 获取渠道名称
                if (TDPChannel > 0)
                {
                    CM_RTChannel_TDP channel = new CM_RTChannel_TDPBLL(TDPChannel).Model;
                    if (channel != null) TDPChannelName = channel.Name;
                }
                #endregion

                #region 获取区域名称
                if (TDPSalesArea > 0)
                {
                    CM_RTSalesArea_TDP area = new CM_RTSalesArea_TDPBLL(TDPSalesArea).Model;
                    if (area != null) TDPSalesAreaName = area.Name;
                }
                #endregion

                #region 获取路线及拜访模板名称
                if (VisitRoute != 0)
                {
                    VST_Route r = new VST_RouteBLL(VisitRoute).Model;
                    if (r != null) VisitRouteName = r.Name;
                }

                if (VisitTemplate != 0)
                {
                    VST_VisitTemplate t = new VST_VisitTemplateBLL(VisitTemplate).Model;
                    if (t != null) VisitTemplateName = t.Name;
                }
                #endregion

                #region 获取销售员名称
                if (Salesman != 0)
                {
                    Org_Staff staff = new Org_StaffBLL(Salesman).Model;
                    if (staff != null) SalesmanName = staff.RealName;
                }
                #endregion

            }
            #endregion

            #region 绑定厂商管理信息
            int manufacturer = 0;           //归属厂商
            if (m.ClientType == 3)
            {
                //门店的归属厂商为当前TDP所归属的厂商
//.........这里部分代码省略.........
开发者ID:fuhongliang,项目名称:GraduateProject,代码行数:101,代码来源:ClientInfo.cs


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