Esempio n. 1
0
    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";
        }
    }
    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() + ")";
    }
Esempio n. 3
0
    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() + ")";
    }
    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";
        }
    }