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


C# CM_ClientBLL.GetManufactInfo方法代码示例

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


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

示例1: bt_CreateUser_Click

    protected void bt_CreateUser_Click(object sender, EventArgs e)
    {
        string UserName = "", Password = "", PositionName = "";

        Org_StaffBLL staff = new Org_StaffBLL((int)ViewState["ID"]);
        if (staff.Model == null) return;
        if (staff.Model.aspnetUserId != null && staff.Model.aspnetUserId != Guid.Empty) return;

        PositionName = new Org_PositionBLL(staff.Model.Position).Model.Name;

        CM_ClientBLL tdp = new CM_ClientBLL((int)Session["OwnerClient"]);
        CM_ClientManufactInfo manufactinfo = tdp.GetManufactInfo(tdp.Model.OwnerClient);
        if (tdp.Model == null) return;

        //用户名默认为当前:TDP代码-员工姓名
        if (manufactinfo != null && !string.IsNullOrEmpty(manufactinfo.Code))
            UserName = manufactinfo.Code;
        else if (!string.IsNullOrEmpty(tdp.Model.Code))
            UserName = tdp.Model.Code;
        else
            UserName = tdp.Model.ID.ToString();
        UserName += "-" + staff.Model.RealName;

        if (Membership.GetUser(UserName) != null) UserName += staff.Model.ID.ToString();

        //密码默认为员工手机号码,为空时则为123456
        Password = staff.Model.Mobile.Trim();
        if (Password == "") Password = "123456";

        //创建用户,并加入角色
        MembershipUser u = Membership.CreateUser(UserName, Password);
        foreach (string rolename in Roles.GetAllRoles().Where(p => p.StartsWith("TDP")))
        {
            if (rolename == PositionName)
            {
                Roles.AddUserToRole(u.UserName, rolename);
            }
        }

        UserBLL.Membership_SetStaffID(u.UserName, staff.Model.ID);
        staff.Model.aspnetUserId = (Guid)u.ProviderUserKey;
        staff.Update();

        MessageBox.ShowAndRedirect(this, "用户创建成功!【用户名:" + UserName + ",初始密码:" + Password + "】", "StaffList.aspx");
    }
开发者ID:fuhongliang,项目名称:GraduateProject,代码行数:45,代码来源:StaffDetail.aspx.cs

示例2: bt_Approve_Click

    protected void bt_Approve_Click(object sender, EventArgs e)
    {
        if ((int)ViewState["ClientID"] != 0)
        {
            CM_ClientBLL _bll = new CM_ClientBLL((int)ViewState["ClientID"]);
            CM_ClientManufactInfo manufactinfo = _bll.GetManufactInfo((int)Session["Manufacturer"]);

            if (string.IsNullOrEmpty(manufactinfo.Code))
            {
                MessageBox.Show(this, "客户编号为空,不能审核通过!");
                return;
            }

            CM_ClientManufactInfoBLL.Approve((int)ViewState["ClientID"], (int)Session["Manufacturer"], (int)Session["UserID"], 3);

            MessageBox.ShowAndRedirect(this, "审核经销商资料成功!", "DistributorList.aspx");
        }
    }
开发者ID:fuhongliang,项目名称:GraduateProject,代码行数:18,代码来源:DistributorDetail.aspx.cs

示例3: bt_Approve_Click

    protected void bt_Approve_Click(object sender, EventArgs e)
    {
        if ((int)ViewState["ClientID"] != 0)
        {
            bt_OK_Click(null, null);

            CM_ClientBLL _bll = new CM_ClientBLL((int)ViewState["ClientID"]);
            CM_ClientManufactInfo manufactinfo = _bll.GetManufactInfo((int)Session["Manufacturer"]);

            //if (string.IsNullOrEmpty(manufactinfo.Code))
            //{
            //    MessageBox.Show(this, "客户编号为空,不能审核通过!");
            //    return;
            //}

            if (manufactinfo.SyncState == 2)
            {
                CM_ClientManufactInfoBLL.Approve((int)ViewState["ClientID"], (int)Session["Manufacturer"], (int)Session["UserID"], 3);

                Response.Redirect("RetailerList.aspx?SyncState=2");
            }
        }
    }
开发者ID:fuhongliang,项目名称:GraduateProject,代码行数:23,代码来源:RetailerDetail.aspx.cs

示例4: RetailerAdd


//.........这里部分代码省略.........
                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, 0, 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();

                #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;

                bll.Model.Address = c.Address;
                bll.Model.DeliveryAddress = 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.OpenTime = DateTime.Parse("1900-01-01 08:00");
                bll.Model.CloseTime = DateTime.Parse("1900-01-01 20:00");
                bll.Model.ClientType = 3;
                bll.Model.InsertStaff = User.StaffID;
                bll.Model.OwnerType = 3;
                bll.Model.OwnerClient = TDPClient.ID;
                bll.Model.ApproveFlag = 2;      //默认为未审核
                #endregion

                int retailerid = bll.Add();
                if (retailerid < 0) { ErrorInfo = "新增门店基本资料失败"; return -3; }    //新增门店基本资料失败

                #region 设置供货商信息
                CM_ClientSupplierInfo supplierinfo = new CM_ClientSupplierInfo();
                supplierinfo.Code = c.CodeBySupplier;
                supplierinfo.Client = retailerid;
                supplierinfo.Supplier = TDP;
                if (User.OwnerType == 3)
                {
                    supplierinfo.Salesman = User.StaffID;
                    IList<VST_Route> routes = VST_RouteBLL.GetRouteListByStaff(User.StaffID);
                    if (routes.Count > 0) supplierinfo.VisitRoute = routes[0].ID;
                }
                supplierinfo.StandardPrice = c.StandardPrice;
                supplierinfo.TDPChannel = c.TDPChannel;
                supplierinfo.TDPSalesArea = c.TDPSalesArea;

                supplierinfo.VisitSequence = c.VisitSequence;
                supplierinfo.VisitTemplate = c.VisitTemplate;
                supplierinfo.InsertStaff = User.StaffID;
                bll.SetSupplierInfo(supplierinfo);
                #endregion

                #region 设置厂商管理信息
                CM_ClientManufactInfo manufactinfo = new CM_ClientManufactInfo();
                manufactinfo.Client = retailerid;
                manufactinfo.Code = c.CodeByManufaturer;
                manufactinfo.Manufacturer = TDPClient.OwnerClient;      //门店归属厂商默认为经销商资料的所属厂商

                if (User.OwnerType == 2)
                {
                    manufactinfo.ClientManager = User.StaffID;

                    IList<VST_Route> routes = VST_RouteBLL.GetRouteListByStaff(User.StaffID);
                    if (routes.Count > 0) manufactinfo.VisitRoute = routes[0].ID;

                }

                //门店所属区域为经销商对应区域
                CM_ClientBLL s = new CM_ClientBLL(TDP);
                manufactinfo.OrganizeCity = s.GetManufactInfo().OrganizeCity;

                bll.SetManufactInfo(manufactinfo);
                #endregion

                #region 保存

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

示例5: BindData

    private void BindData()
    {
        CM_ClientBLL clientbll = new CM_ClientBLL((int)ViewState["ClientID"]);
        CM_Client m = clientbll.Model;
        if (m == null) Response.Redirect("RetailerList.aspx");

        switch (m.ClientType)
        {
            case 1:
                Response.Redirect("../Store/StoreDetail.aspx?ClientID=" + m.ID.ToString());
                break;
            case 2:
                Response.Redirect("../DI/DistributorDetail.aspx?ClientID=" + m.ID.ToString());
                break;
            case 3:
                break;
            default:
                MessageBox.ShowAndRedirect(this, "请先在‘零售商列表’中选择要查看的零售商!", "RetailerList.aspx?URL=" + Request.Url.PathAndQuery);
                break;
        }

        CM_ClientSupplierInfo supplierinfo = clientbll.GetSupplierInfoByManufacturer((int)Session["Manufacturer"]);
        CM_ClientManufactInfo manufactinfo = clientbll.GetManufactInfo((int)Session["Manufacturer"]);

        pl_detail.BindData(m);

        if (supplierinfo != null) pl_detail.BindData(supplierinfo);
        if (manufactinfo != null)
        {
            BindGeoCode(m.OfficialCity);
            BindVisitRoute(manufactinfo.OrganizeCity);
            pl_detail.BindData(manufactinfo);
        }

        MCSSelectControl select_ClientManager = (MCSSelectControl)pl_detail.FindControl("CM_ClientManufactInfo_ClientManager");
        if (select_ClientManager != null)
        {
            select_ClientManager.PageUrl = "~/SubModule/StaffManage/Pop_Search_Staff.aspx?OrganizeCity=" + manufactinfo.OrganizeCity.ToString() + "&IncludeSuperManager=Y";
        }

        if (manufactinfo != null)
        {
            if (manufactinfo.SyncState != 0 && manufactinfo.SyncState != 1 && manufactinfo.SyncState != 8) bt_Submit.Visible = false;
            if (manufactinfo.SyncState != 2) { bt_Approve.Visible = false; bt_UnApprove.Visible = false; }

            //有公司客户编号后,页面为编辑权限模式
            if (!string.IsNullOrEmpty(manufactinfo.Code)) Header.Attributes["WebPageSubCode"] = "Modify";
        }

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

示例6: bt_UnApprove_Click

    protected void bt_UnApprove_Click(object sender, EventArgs e)
    {
        if ((int)ViewState["ClientID"] != 0)
        {
            bt_OK_Click(null, null);

            CM_ClientBLL _bll = new CM_ClientBLL((int)ViewState["ClientID"]);
            CM_ClientManufactInfo manufactinfo = _bll.GetManufactInfo((int)Session["Manufacturer"]);

            if (manufactinfo.SyncState == 2)
            {
                CM_ClientManufactInfoBLL.Approve((int)ViewState["ClientID"], (int)Session["Manufacturer"], (int)Session["UserID"], 8);

                Response.Redirect("RetailerList.aspx?SyncState=2");
            }
        }
    }
开发者ID:fuhongliang,项目名称:GraduateProject,代码行数:17,代码来源:RetailerDetail.aspx.cs

示例7: bt_Submit_Click

    protected void bt_Submit_Click(object sender, EventArgs e)
    {
        if ((int)ViewState["ClientID"] != 0)
        {
            bt_OK_Click(null, null);
            CM_ClientBLL _bll = new CM_ClientBLL((int)ViewState["ClientID"]);
            CM_ClientManufactInfo manufactinfo = _bll.GetManufactInfo((int)Session["Manufacturer"]);

            #region 判断必填项

            #endregion

            if (manufactinfo.SyncState == 0 || manufactinfo.SyncState == 1 || manufactinfo.SyncState == 8)
            {
                CM_ClientManufactInfoBLL.Approve((int)ViewState["ClientID"], (int)Session["Manufacturer"], (int)Session["UserID"], 2);
                Response.Redirect("RetailerList.aspx?SyncState=1");
            }
        }
    }
开发者ID:fuhongliang,项目名称:GraduateProject,代码行数:19,代码来源:RetailerDetail.aspx.cs

示例8: bt_OK_Click

    protected void bt_OK_Click(object sender, EventArgs e)
    {
        CM_ClientBLL _bll = null;
        if (ViewState["ClientID"] == null || (int)ViewState["ClientID"] == 0)
        {
            _bll = new CM_ClientBLL();
        }
        else
        {
            _bll = new CM_ClientBLL((int)ViewState["ClientID"]);
        }

        CM_ClientSupplierInfo supplierinfo = _bll.GetSupplierInfo((int)Session["OwnerClient"]);
        CM_ClientManufactInfo manufactinfo = _bll.GetManufactInfo((int)Session["Manufacturer"]);

        if (supplierinfo == null)
        {
            supplierinfo = new CM_ClientSupplierInfo();
            supplierinfo.Supplier = (int)Session["OwnerClient"];
        }
        if (manufactinfo == null)
        {
            manufactinfo = new CM_ClientManufactInfo();
            manufactinfo.Manufacturer = (int)Session["Manufacturer"];

            //门店所属区域为经销商对应区域
            CM_ClientBLL s = new CM_ClientBLL((int)Session["OwnerClient"]);
            manufactinfo.OrganizeCity = s.GetManufactInfo().OrganizeCity;
        }

        pl_detail.GetData(_bll.Model);
        pl_detail.GetData(supplierinfo);

        #region 判断必填项
        #endregion

        #region 判断活跃标志
        if (supplierinfo.State == 1 && supplierinfo.EndDate != new DateTime(1900, 1, 1))
            supplierinfo.EndDate = new DateTime(1900, 1, 1);

        if (supplierinfo.State == 2 && supplierinfo.EndDate == new DateTime(1900, 1, 1))
            supplierinfo.EndDate = DateTime.Now;
        #endregion

        if (ViewState["ClientID"] == null || (int)ViewState["ClientID"] == 0)
        {
            _bll.Model.ClientType = 3;
            _bll.Model.ApproveFlag = 1;
            _bll.Model.InsertStaff = (int)Session["UserID"];
            _bll.Model.OwnerType = 3;           //所属经销商
            _bll.Model.OwnerClient = (int)Session["OwnerClient"];
            ViewState["ClientID"] = _bll.Add();

            _bll.SetSupplierInfo(supplierinfo);
            _bll.SetManufactInfo(manufactinfo);
        }
        else
        {
            _bll.Model.UpdateStaff = (int)Session["UserID"];
            _bll.Update();
            _bll.SetSupplierInfo(supplierinfo);
            _bll.SetManufactInfo(manufactinfo);
        }

        Response.Redirect("RetailerDetail.aspx?ClientID=" + ViewState["ClientID"].ToString());
    }
开发者ID:fuhongliang,项目名称:GraduateProject,代码行数:66,代码来源:RetailerDetail.aspx.cs

示例9: BindData

    private void BindData()
    {
        int clientID = 0;
        if (ViewState["ClientID"] == null || !int.TryParse(ViewState["ClientID"].ToString(), out clientID)) return;

        CM_ClientBLL clientbll = new CM_ClientBLL(clientID);
        CM_Client m = clientbll.Model;
        if (m == null) Response.Redirect("DistributorList.aspx");

        switch (m.ClientType)
        {
            case 1:
                Response.Redirect("../Store/StoreDetail.aspx?ClientID=" + m.ID.ToString());
                break;
            case 2:
                break;
            case 3:
                Response.Redirect("../RT/RetailerDetail.aspx?ClientID=" + m.ID.ToString());
                break;
            default:
                MessageBox.ShowAndRedirect(this, "请先在‘经销商列表’中选择要查看的经销商!", "DistributorList.aspx?URL=" + Request.Url.PathAndQuery);
                break;
        }
        pl_detail.BindData(m);

        tr_OfficialCity_Selected(null, null);
        tr_OrganizeCity_Selected(null, null);

        CM_ClientSupplierInfo supplierinfo = clientbll.GetSupplierInfoByManufacturer((int)Session["Manufacturer"]);
        CM_ClientManufactInfo manufactinfo = clientbll.GetManufactInfo((int)Session["Manufacturer"]);

        if (supplierinfo != null) pl_detail.BindData(supplierinfo);
        if (manufactinfo != null) pl_detail.BindData(manufactinfo);

        MCSSelectControl select_ClientManager = (MCSSelectControl)pl_detail.FindControl("CM_ClientManufactInfo_ClientManager");
        if (select_ClientManager != null && manufactinfo != null)
        {
            select_ClientManager.PageUrl = "~/SubModule/StaffManage/Pop_Search_Staff.aspx?OrganizeCity=" + manufactinfo.OrganizeCity.ToString() + "&IncludeSuperManager=Y";
        }
        if (manufactinfo != null && manufactinfo.ApproveFlag == 1)
        {
            //已审核
            TextBox tbx_BeginDate = (TextBox)pl_detail.FindControl("CM_ClientManufactInfo_BeginDate");
            if (tbx_BeginDate != null && tbx_BeginDate.Text != "") tbx_BeginDate.Enabled = false;
            TextBox tbx_Code = (TextBox)pl_detail.FindControl("CM_ClientManufactInfo_Code");
            if (tbx_Code != null) tbx_Code.Enabled = false;

            bt_Approve.Visible = false;
            Header.Attributes["WebPageSubCode"] = "Modify";
        }
    }
开发者ID:fuhongliang,项目名称:GraduateProject,代码行数:51,代码来源:DistributorDetail.aspx.cs

示例10: DoImportStaff

        /// <summary>
        /// 导入员工资料
        /// </summary>
        /// <param name="TemplateID"></param>
        /// <param name="Staff"></param>
        /// <param name="StaffSheet"></param>
        /// <param name="State">3:成功 4:失败 5:部分成功</param>
        /// <returns></returns>
        //public string DoImportStaff(int TemplateID, int Client, ISheet StaffSheet, out int State)
        public string DoImportStaff(int TemplateID, int Client, ISheet Sheet, out int State)
        {
            string ImportInfo = "【员工资料】Excel表:";
            State = 0;
            IPT_UploadTemplateBLL _template = new IPT_UploadTemplateBLL(TemplateID);

            List<string> listPDT = new List<string>() { "序号", "姓名", "职务", "手机号码", "关联车号", "身份证号" };

            DataTable dt = null;
            bool flag = VertifySheet(Sheet, listPDT, out dt, ref ImportInfo);
            if (!flag) { State = 4; return ImportInfo; }

            foreach (DataRow dr in dt.Rows)//循环导入数据
            {
                try
                {
                    string _staffName = dr["姓名"].ToString();

                    IList<Org_Staff> _listStaff = Org_StaffBLL.GetStaffList("  Dimission=1 AND OwnerClient=" + _template.Model.ClientID.ToString() + " AND RealName='" + _staffName + "'");
                    if (_listStaff != null && _listStaff.Count > 0)
                    {
                        ImportInfo += string.Format("导入序列号为{0},名字为{1}的数据行时与现有员工名字重复,跳过此行\r\n", dr["序号"].ToString(), _staffName);
                        continue;
                    }

                    int _staffPosition = 0; string _strStaffPosition = dr["职务"].ToString();
                    string _staffPhone = dr["手机号码"].ToString();
                    string _staffIDCode = dr["身份证号"].ToString();
                    if (!string.IsNullOrEmpty(_strStaffPosition))//无职位默认为业代
                    {
                        IList<Org_Position> _listPosition = Org_PositionBLL.GetModelList(" Name='" + _strStaffPosition + "'");
                        if (_listPosition != null && _listPosition.Count > 0) _staffPosition = _listPosition[0].ID;
                    }
                    else { _staffPosition = 1030; }

                    Org_StaffBLL _bllStaff = new Org_StaffBLL();
                    CM_ClientBLL c = new CM_ClientBLL(_template.Model.ClientID);
                    CM_ClientManufactInfo manufactinfo = c.GetManufactInfo();
                    if (c != null && manufactinfo != null)
                    {
                        _bllStaff.Model.OrganizeCity = manufactinfo.OrganizeCity;
                        _bllStaff.Model.OfficialCity = c.Model.OfficialCity;
                    }
                    _bllStaff.Model.RealName = _staffName;
                    _bllStaff.Model.Position = _staffPosition;
                    _bllStaff.Model.Mobile = _staffPhone;
                    _bllStaff.Model.TeleNum = _staffPhone;
                    _bllStaff.Model.IDCode = _staffIDCode;
                    _bllStaff.Model.InsertStaff = _template.Model.InsertStaff;
                    _bllStaff.Model.OwnerClient = _template.Model.ClientID;
                    _bllStaff.Model.OwnerType = 3;
                    _bllStaff.Model.Dimission = 1;
                    _bllStaff.Model.ApproveFlag = 1;
                    int _ClientID = _bllStaff.Add();//当前员工ID
                    //创建默认员工线路
                    if (_ClientID > 0)
                    {
                        if (_bllStaff.Model.Position == 1030)//业待创建默认路线
                        {
                            VST_RouteBLL routebll = new VST_RouteBLL();
                            routebll.Model.Code = "R" + _ClientID.ToString();
                            routebll.Model.Name = "线路-" + _bllStaff.Model.RealName;
                            routebll.Model.RelateStaff = _ClientID;
                            routebll.Model.OrganizeCity = _bllStaff.Model.OrganizeCity;
                            routebll.Model.OwnerClient = _template.Model.ClientID;
                            routebll.Model.OwnerType = 3;
                            routebll.Model.ApproveFlag = 1;
                            routebll.Model.EnableFlag = "Y";
                            routebll.Model.InsertStaff = _template.Model.InsertStaff;
                            routebll.Add();
                        }
                        if (_bllStaff.Model.Position == 1030 || _bllStaff.Model.Position == 1050)//只有业待和司机能关联车号
                        {
                            #region 获取车号ID
                            int _staffCar = 0; string _strStaffCar = dr["关联车号"].ToString();
                            if (!string.IsNullOrEmpty(_strStaffCar))
                            {
                                IList<CM_Vehicle> _listVehicles = CM_VehicleBLL.GetModelList("Client=" + _template.Model.ClientID + " AND VehicleNo='" + _strStaffPosition + "' ");
                                if (_listVehicles != null && _listVehicles.Count > 0) _staffCar = _listVehicles[0].ID;
                                else
                                {
                                    CM_VehicleBLL vehicle = new CM_VehicleBLL();
                                    vehicle.Model.Client = _template.Model.ClientID;
                                    vehicle.Model.VehicleNo = _strStaffCar;
                                    vehicle.Model.State = 1;
                                    vehicle.Model.Remark = "新导入未确认";
                                    vehicle.Model.VehicleClassify = 2;
                                    _staffCar = vehicle.Add();
                                }
                            }
                            #endregion
//.........这里部分代码省略.........
开发者ID:fuhongliang,项目名称:GraduateProject,代码行数:101,代码来源:ClientInit.cs

示例11: DoImportClient

        public string DoImportClient(int TemplateID, int Client, ISheet Sheet, out int State)
        {
            string ImportInfo = "【客户资料】Excel表:";
            State = 0;
            IPT_UploadTemplateBLL _template = new IPT_UploadTemplateBLL(TemplateID);

            List<string> listClient = new List<string>() { "序号", "区域", "渠道", "客户编号", "客户名称", "联系人", "地址", "电话", "手机", "销售线路", "备注" };

            DataTable dt = null;
            bool flag = VertifySheet(Sheet, listClient, out dt, ref ImportInfo);
            if (!flag) { State = 4; return ImportInfo; }

            foreach (DataRow dr in dt.Rows)//循环导入数据
            {
                try
                {
                    string _ClientCode = dr["客户编号"].ToString();//客户自编码
                    string _ClientName = dr["客户名称"].ToString();

                    if (string.IsNullOrEmpty(_ClientCode))// && string.IsNullOrEmpty(_ClientName)
                    {
                        ImportInfo += "导入序列号为" + dr["序号"].ToString() + "的数据行时找不到门店编码,跳过此行记录\r\n";//门店名称和
                        continue;
                    }
                    IList<CM_Client> _listClient = CM_ClientBLL.GetModelList(" ApproveFlag=1 AND ClientType=3 AND OwnerType=3 AND OwnerClient=" + _template.Model.ClientID + "AND EXISTS(SELECT 1 FROM MCS_CM.dbo.CM_ClientSupplierInfo WHERE Supplier=" + _template.Model.ClientID + " AND Client= CM_Client.id  AND Code=" + _ClientCode + " ) ");
                    if (_listClient != null && _listClient.Count > 0)
                    {
                        ImportInfo += "导入序列号为" + dr["序号"].ToString() + "的数据行时找到相同编码的门店,跳过此行记录\r\n";
                        continue;
                    }

                    string _ClientLinkMan = dr["联系人"].ToString();
                    string _ClientAddress = dr["地址"].ToString();
                    string _ClientTel = dr["电话"].ToString();
                    string _ClientMobile = dr["手机"].ToString();
                    #region 获取线路
                    string _strClientVisitRoute = dr["销售线路"].ToString();//业务拜访模板Code
                    VST_Route _route = null;
                    if (!string.IsNullOrEmpty(_strClientVisitRoute))//优先匹配厂商级的拜访记录
                    {
                        _route = VST_RouteBLL.GetModelList(" OwnerType IN(1,2) AND Code='" + _strClientVisitRoute + "'").FirstOrDefault();//IList<VST_Route>_listRoute
                        if (_route == null)//找不到厂商级的线路找经销商级别的
                        {
                            _route = VST_RouteBLL.GetModelList(" OwnerType=3 AND OwnerClient=" + _template.Model.ClientID + " AND Code='" + _strClientVisitRoute + "'").FirstOrDefault();
                        }
                    }
                    /*模板中存在负责业务时获取门店业代和拜访记录代码
                     int _ClientSalesMan = 0;//负责业务
                     int _ClientVisitRoute = 0;//业务拜访模板ID
                    string _strClientSalesMan = dr["负责业务"].ToString();
                    if (!string.IsNullOrEmpty(_strClientSalesMan))
                    {
                        IList<Org_Staff> _listStaff = Org_StaffBLL.GetStaffList(" OwnerClient=" + _template.Model.ClientID + " AND OwnerType=3 AND RealName='" + _strClientSalesMan + "'");
                        if (_listStaff != null && _listStaff.Count > 0)
                        {
                            _ClientSalesMan = _listStaff[0].ID;
                            IList<VST_Route> _listRoute = VST_RouteBLL.GetModelList(" OwnerClient=" + _template.Model.ClientID + " AND RelateStaff=" + _ClientSalesMan);
                            if (_listRoute != null && _listRoute.Count > 0) _ClientVisitRoute = _listRoute[0].ID;
                        }
                        else
                        {
                            Org_StaffBLL _bllStaff = new Org_StaffBLL();
                            CM_ClientBLL c = new CM_ClientBLL(_template.Model.ClientID);
                            CM_ClientManufactInfo manufactinfo = c.GetManufactInfo();
                            if (c != null && manufactinfo != null)
                            {
                                _bllStaff.Model.OrganizeCity = manufactinfo.OrganizeCity;
                                _bllStaff.Model.OfficialCity = c.Model.OfficialCity;
                            }
                            _bllStaff.Model.RealName = _strClientSalesMan;
                            _bllStaff.Model.Position = 1030;//默认为业务员
                            _bllStaff.Model.InsertStaff = _template.Model.InsertStaff;
                            _bllStaff.Model.OwnerClient = _template.Model.ClientID;
                            _bllStaff.Model.OwnerType = 3;
                            _bllStaff.Model.Dimission = 1;
                            _bllStaff.Model.ApproveFlag = 1;
                            _ClientSalesMan = _bllStaff.Add();
                            //创建默认员工线路
                            if (_ClientSalesMan > 0)
                            {
                                if (_bllStaff.Model.Position == 1030)
                                {
                                    VST_RouteBLL routebll = new VST_RouteBLL();
                                    routebll.Model.Code = "R" + _ClientSalesMan.ToString();
                                    routebll.Model.Name = "线路-" + _bllStaff.Model.RealName;
                                    routebll.Model.RelateStaff = _ClientSalesMan;
                                    routebll.Model.OrganizeCity = _bllStaff.Model.OrganizeCity;
                                    routebll.Model.OwnerClient = _template.Model.ClientID;
                                    routebll.Model.OwnerType = 3;
                                    routebll.Model.ApproveFlag = 1;
                                    routebll.Model.EnableFlag = "Y";
                                    routebll.Model.InsertStaff = _template.Model.InsertStaff;
                                    _ClientVisitRoute = routebll.Add();
                                }
                            }
                        }
                    }*/
                    #endregion
                    string _ClientRemark = dr["备注"].ToString();

//.........这里部分代码省略.........
开发者ID:fuhongliang,项目名称:GraduateProject,代码行数:101,代码来源:ClientInit.cs

示例12: BindDropDown

    private void BindDropDown()
    {
        ddl_ClientType.DataSource = DictionaryBLL.GetDicCollections("CM_ClientType");
        ddl_ClientType.DataBind();
        ddl_ClientType.Items.Insert(0, new ListItem("请选择...", "0"));

        //if (!Right_Assign_BLL.GetAccessRight(Session["UserName"].ToString(), 17, "ViewStoreInPopSearch"))
        //{
        //    //在弹出窗口中查看仓库列表
        //    if (ddl_ClientType.Items.FindByValue("1") != null) ddl_ClientType.Items.FindByValue("1").Enabled = false;
        //}

        if (!Right_Assign_BLL.GetAccessRight(Session["UserName"].ToString(), 12, "ViewDIInPopSearch"))
        {
            //在弹出窗口中查看经销商列表
            if (ddl_ClientType.Items.FindByValue("2") != null) ddl_ClientType.Items.FindByValue("2").Enabled = false;
        }

        if (!Right_Assign_BLL.GetAccessRight(Session["UserName"].ToString(), 11, "ViewRTInPopSearch") && (int)Session["OwnerType"] != 3)
        {
            //在弹出窗口中查看门店列表
            if (ddl_ClientType.Items.FindByValue("3") != null) ddl_ClientType.Items.FindByValue("3").Enabled = false;
        }

        if (!Right_Assign_BLL.GetAccessRight(Session["UserName"].ToString(), 801, "ViewHPInPopSearch"))
        {
            //在弹出窗口中查看医院列表
            if (ddl_ClientType.Items.FindByValue("5") != null) ddl_ClientType.Items.FindByValue("5").Enabled = false;
        }

        #region 绑定用户可管辖的管理片区
        if ((int)Session["AccountType"] == 1)
        {
            Org_StaffBLL staff = new Org_StaffBLL((int)Session["UserID"]);
            tr_OrganizeCity.DataSource = staff.GetStaffOrganizeCity();

            if (tr_OrganizeCity.DataSource.Select("ID = 1").Length > 0)
            {
                tr_OrganizeCity.RootValue = "0";
                tr_OrganizeCity.SelectValue = "1";
            }
            else
            {
                tr_OrganizeCity.RootValue = new Addr_OrganizeCityBLL(staff.Model.OrganizeCity).Model.SuperID.ToString();
                tr_OrganizeCity.SelectValue = staff.Model.OrganizeCity.ToString();
            }

            #region 获取当前员工的关联经销商
            int _relateclient = 0;
            if (staff.Model["RelateClient"] != "" && int.TryParse(staff.Model["RelateClient"], out _relateclient))
            {
                ViewState["RelateClient"] = _relateclient;
            }
            #endregion
        }
        else if ((int)Session["AccountType"] == 2)
        {
            CM_ClientBLL client = new CM_ClientBLL((int)Session["UserID"]);
            if (client.Model != null)
            {
                int city = client.GetManufactInfo(client.Model.OwnerClient).OrganizeCity;
                Addr_OrganizeCityBLL citybll = new Addr_OrganizeCityBLL(city);
                tr_OrganizeCity.DataSource = citybll.GetAllChildNodeIncludeSelf();
                tr_OrganizeCity.RootValue = citybll.Model.SuperID.ToString();
                tr_OrganizeCity.SelectValue = city.ToString();
            }
        }
        #endregion
    }
开发者ID:fuhongliang,项目名称:GraduateProject,代码行数:69,代码来源:Search_SelectClient.aspx.cs

示例13: bt_OK_Click

    protected void bt_OK_Click(object sender, EventArgs e)
    {
        Org_StaffBLL _bll;
        if ((int)ViewState["ID"] != 0)
        {
            //修改
            _bll = new Org_StaffBLL((int)ViewState["ID"]);
        }
        else
        {
            //新增
            _bll = new Org_StaffBLL();
        }

        pl_detail.GetData(_bll.Model);

        #region 判断必填项
        if (_bll.Model.Position == 0 || _bll.Model.Position == 1000)
        {
            MessageBox.Show(this, "请选择员工所属的职位!");
            return;
        }
        #endregion

        #region 判断在职标志
        if (_bll.Model.Dimission == 1)
        {
            if (_bll.Model.BeginWorkTime.Year == 1900) _bll.Model.BeginWorkTime = DateTime.Today;
            if (_bll.Model.EndWorkTime.Year != 1900) _bll.Model.EndWorkTime = new DateTime(1900, 1, 1);
        }
        else if (_bll.Model.Dimission == 2)
        {
            if (_bll.Model.EndWorkTime.Year == 1900) _bll.Model.EndWorkTime = DateTime.Today;
        }
        #endregion

        #region 判断手机号码有效性
        if (_bll.Model.Mobile.StartsWith("01")) _bll.Model.Mobile = _bll.Model.Mobile.Substring(1);
        if (Org_StaffBLL.GetStaffList("Dimission=1 AND Mobile='" + _bll.Model.Mobile + "' AND ID <> " + _bll.Model.ID.ToString()).Count > 0)
        {
            MessageBox.Show(this, "手机号码和系统中其他员工的手机号码重复,请检查是否正确!");
            return;
        }
        #endregion

        if ((int)ViewState["ID"] != 0)
        {
            //修改
            _bll.Model.UpdateStaff = (int)Session["UserID"];
            if (_bll.Update() == 0)
            {
                #region 创建默认职位为业务员的线路
                if (_bll.Model.Position == 1030 && VST_RouteBLL.GetRouteListByStaff(_bll.Model.ID).Count == 0)
                {
                    CreateRoute(_bll.Model.RealName, _bll.Model.OrganizeCity);
                }
                #endregion

                MessageBox.ShowAndRedirect(this, "保存成功!", "StaffDetail.aspx?ID=" + ViewState["ID"].ToString());
            }
        }
        else
        {
            //新增

            CM_ClientBLL c = new CM_ClientBLL((int)Session["OwnerClient"]);
            CM_ClientManufactInfo manufactinfo = c.GetManufactInfo();
            if (c != null && manufactinfo != null)
            {
                _bll.Model.OrganizeCity = manufactinfo.OrganizeCity;
                _bll.Model.OfficialCity = c.Model.OfficialCity;
            }

            _bll.Model.InsertStaff = (int)Session["UserID"];
            _bll.Model.OwnerClient = (int)Session["OwnerClient"];
            _bll.Model.OwnerType = (int)Session["OwnerType"];
            if (_bll.Model.Dimission == 0) _bll.Model.Dimission = 1;

            _bll.Model.ApproveFlag = 1;
            ViewState["ID"] = _bll.Add();

            if ((int)ViewState["ID"] > 0)
            {
                #region 创建默认职位为业务员的线路
                if (_bll.Model.Position == 1030)
                {
                    CreateRoute(_bll.Model.RealName, _bll.Model.OrganizeCity);
                }
                #endregion

                Response.Redirect("StaffDetail.aspx?ID=" + ViewState["ID"].ToString());
            }
        }
    }
开发者ID:fuhongliang,项目名称:GraduateProject,代码行数:94,代码来源:StaffDetail.aspx.cs

示例14: FillClientInfo


//.........这里部分代码省略.........
                    {
                        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所归属的厂商
                CM_Client supplier = new CM_ClientBLL(TDP).Model;
                if (supplier != null) manufacturer = supplier.OwnerClient;
            }
            else if (m.ClientType == 2)
            {
                //TDP经销商的归属厂商
                manufacturer = m.OwnerClient;
            }

            CM_ClientManufactInfo ManufactInfo = ClientBLL.GetManufactInfo(manufacturer);
            if (ManufactInfo != null)
            {
                CodeByManufaturer = ManufactInfo.Code;
            }
            #endregion

            #region 绑定客户定位信息
            CM_ClientGeoInfo geo = CM_ClientGeoInfoBLL.GetGeoInfoByClient(m.ID);
            if (geo != null)
            {
                Latitude = (float)geo.Latitude;
                Longitude = (float)geo.Longitude;
            }
            #endregion

            #region 绑定客户供货产品目录
            ClientProductLists = new List<ProductList>();
            foreach (CM_ClientProductList item in CM_ClientProductListBLL.GetModelList
                ("Client=" + m.ID.ToString() + (TDP == 0 ? "" : " AND Supplier=" + TDP.ToString())))
            {
                ClientProductLists.Add(new ProductList(item));
            }
            #endregion

            #region 查询预收款余额
            AC_CurrentAccount ac = AC_CurrentAccountBLL.GetByTradeClient(TDP, m.ID);
            if (ac != null) ARBalance = ac.PreReceivedAmount - ac.AR;
            #endregion

            #region 获取附件明细
            IList<ATMT_Attachment> atts = ATMT_AttachmentBLL.GetAttachmentList(30, m.ID, DateTime.Today.AddMonths(-3), new DateTime(2100, 1, 1));
            Atts = new List<Attachment>(atts.Count);
            foreach (ATMT_Attachment item in atts.OrderByDescending(p => p.UploadTime))
            {
                Atts.Add(new Attachment(item));
            }
            #endregion
        }
开发者ID:fuhongliang,项目名称:GraduateProject,代码行数:101,代码来源:ClientInfo.cs


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