コード例 #1
0
    protected void Button26_Click(object sender, EventArgs e)
    {
        Label3.Text = "";
        Area area = Areas.GetArea(6);

        Label3.Text = area.RegionName;
    }
コード例 #2
0
    void BindSupply()
    {
        int           id = int.Parse(Request.QueryString["ID"]);
        ProductSupply ps = ProductSupplyManager.GetProductSupply(id);
        Company       c  = Companys.GetCompany(ps.SupplierID);
        Area          a  = Areas.GetArea(c.CompanyRegion);
        string        AN = "--";

        if (a != null)
        {
            AN = a.RegionName;
        }
        ltCompanyName.Text = "<a class=\"navCompany\" href=\"javascript:{}\">[" + c.CompanyName +
                             "]<div class=\"companyDetailsRemark_s\">" +
                             "<div>区域:" + AN + "</div>" +
                             "<div>组织机构代码:" + c.Orgcode + "</div>" +
                             "<div>工商注册号码:" + c.Regcode + "</div>" +
                             "<div>联系电话:" + c.Phone + "</div>" +
                             "<div>公司传真:" + c.Fax + "</div>" +
                             "<div>联系地址:" + c.Address + "</div>" +
                             "<div>邮政编码:" + c.Zipcode + "</div>" +
                             "<div>公司主页:" + c.Website + "</div>" +
                             "</div></a>";
        ltFaxRate.Text = ps.ApplyTaxRate.ToString("P2");
        dsDeliverySpan.DateSpanValue = ps.DeliverySpan;
        ltCreateTime.Text            = ps.CreateTime.ToShortDateString();
        ltCreateUser.Text            = Users.GetUser(ps.CreateUser).UserName;
        ltHasfeight.Text             = (ps.IncludeFreight == FreightIncludeType.Include ? "是" : "<span class='needed'>否</span>");
        ltIncludeTax.Text            = (ps.IncludeTax == TaxIncludeType.Include ? "是" : "<span class='needed'>否</span>");

        if (ps.SupplyRegion == null)
        {
            ltRegion.Text = "全国";
        }
        else
        {
            AN = string.Empty;
            a  = Areas.GetArea(ps.SupplyRegion.Value);
            if (a != null)
            {
                AN = a.RegionName;
            }
            ltRegion.Text = a.RegionName;
        }

        ltStartTime.Text    = ps.QuoteFrom.ToShortDateString();
        ltEndTime.Text      = ps.QuoteEnd.ToShortDateString();
        ltAmount.Text       = (ps.QuoteMOQ == null ? "无要求" : ps.QuoteMOQ.Value.ToString());
        ltPrice.Text        = GlobalSettings.GetPrice(ps.QuotePrice);
        ltQuoteRenewal.Text = (ps.QuoteRenewal == 0 ? "无" : ps.QuoteRenewal + "月");
        dsWS.DateSpanValue  = ps.WarrantySpan;
        ltSupply.Text       = (ps.SupplyStatus == ComponentStatus.Enabled ? "是" : "<span class='needed'>否</span>");
    }
コード例 #3
0
    void BindCD()
    {
        User u = Profile.AccountInfo;

        if (u.UserType == UserType.InnerUser)
        {
            mbNC.ShowMsg("内部员工没有相关的公司信息,请选择其它信息进行查看!", System.Drawing.Color.Olive);
            pnlNormal.Visible  = false;
            pnlManager.Visible = false;
        }
        else
        {
            if (u.IsManager == 1)
            {
                pnlManager.Visible = true;
                pnlNormal.Visible  = false;
            }
            else
            {
                pnlManager.Visible = false;
                pnlNormal.Visible  = true;
            }
            mbNC.HideMsg();
            c = Companys.GetCompanyByUser(u.UserID);
            ltCompanyName.Text = c.CompanyName;
            ltName.Text        = c.CompanyName;
            hfRegionCode.Value = c.CompanyRegion.ToString();
            try
            {
                Area a = Areas.GetArea(c.CompanyRegion);
                txtRegion.Text = a.RegionName;
                ltArea.Text    = a.RegionName;
            }
            catch { }
            txtCompanyPhone.Text   = c.Phone;
            ltPhone.Text           = c.Phone;
            txtCompanyFax.Text     = c.Fax;
            ltFax.Text             = c.Fax;
            txtCompanyAddress.Text = c.Address;
            ltAddress.Text         = c.Address;
            txtZipCode.Text        = c.Zipcode;
            ltZipcode.Text         = c.Zipcode;
            txtCompanyWebsite.Text = c.Website;
            ltWebsite.Text         = "<a href='" + c.Website + "' target='_blank' style='color:#0000ff' >" + c.Website + "</a>";
            txtOrgCode.Text        = c.Orgcode;
            ltOrgCode.Text         = c.Orgcode;
            txtIcpCode.Text        = c.Regcode;
            ltRegCode.Text         = c.Regcode;
            txtCompanyMemo.Text    = c.Remark;
            ltDescription.Text     = c.Remark;
        }
    }
コード例 #4
0
 void BindRegion()
 {
     try
     {
         int regId = int.Parse(hfRegionCode.Value);
         if (regId != 0)
         {
             Area a = Areas.GetArea(regId);
             txtRegion.Text = a.RegionName;
         }
     }
     catch { }
 }
コード例 #5
0
 public string GetRegion(string areaId)
 {
     try
     {
         if (string.IsNullOrEmpty(areaId))
         {
             return("--");
         }
         int id = int.Parse(areaId);
         a = Areas.GetArea(id);
         return(a.RegionName);
     }
     catch
     {
         return("--");
     }
 }
コード例 #6
0
    void BindCompany()
    {
        int comId = int.Parse(Request.QueryString["CompanyID"]);
        int pId   = int.Parse(Request.QueryString["PendingID"]);

        btnUpdateQualify.PostBackUrl = "CompanyQualify.aspx?ID=" + comId;
        btnUpdateDeposit.PostBackUrl = "CompanyDeposit.aspx?ID=" + comId;
        btnUpdateCredit.PostBackUrl  = "CompanyCredit.aspx?ID=" + comId;
        Company c = Companys.GetCompany(comId);

        ltCompanyName.Text = c.CompanyName;
        ltAddress.Text     = c.Address;
        ltFax.Text         = c.Fax;
        ltOrgCode.Text     = c.Orgcode;
        ltPhone.Text       = c.Phone;
        ltRegCode.Text     = c.Regcode;
        try
        {
            ltRegion.Text = Areas.GetArea(c.CompanyRegion).RegionName;
        }
        catch { ltRegion.Text = "--"; }
        ltRemark.Text = c.Remark;
        if (!string.IsNullOrEmpty(c.Website))
        {
            ltWebSite.Text = "<a href='" + c.Website + "' target='_blank'>" + c.Website + "</a>";
        }
        else
        {
            ltWebSite.Text = "--";
        }
        ltZipCode.Text     = c.Zipcode;
        ltCompanyType.Text = GetCompanyType(c.CompanyType);
        Pending p = Pendings.PendingGetById(pId);

        ltPendingType.Text = GetCompanyType(p.CompanyType);
    }
コード例 #7
0
    void BindData()
    {
        try
        {
            int id = int.Parse(Request.QueryString["ID"]);
            lbAdd.PostBackUrl            = "UserEdit.aspx?ID=" + id + "&Mode=Add";
            btnUpdateQualify.PostBackUrl = "CompanyQualify.aspx?ID=" + id;
            btnUpdateDeposit.PostBackUrl = "CompanyDeposit.aspx?ID=" + id;
            btnUpdateCredit.PostBackUrl  = "CompanyCredit.aspx?ID=" + id;
            c = Companys.GetCompany(id);
            txtCompanyName.Text = c.CompanyName;
            try
            {
                hfRegionCode.Value = c.CompanyRegion.ToString();
                Area a = Areas.GetArea(c.CompanyRegion);
                txtRegion.Text = a.RegionName;
            }
            catch { }
            cslMain.SelectedValue  = c.CompanyStatus;
            txtCompanyPhone.Text   = c.Phone;
            txtCompanyFax.Text     = c.Fax;
            txtCompanyAddress.Text = c.Address;
            txtZipCode.Text        = c.Zipcode;
            txtCompanyWebsite.Text = c.Website;
            txtOrgCode.Text        = c.Orgcode;
            txtIcpCode.Text        = c.Regcode;
            txtCompanyMemo.Text    = c.Remark;

            UserQuery query = new UserQuery();
            query.CompanyID     = c.CompanyID;
            query.UserType      = UserType.CompanyUser;
            query.AccountStatus = AccountStatus.All;
            PagingDataSet <User> pds   = Users.GetUsers(query, false);
            List <User>          users = pds.Records;
            if (users.Count == 0)
            {
                ltUsers.Text = "无";
            }
            else
            {
                StringBuilder sb = new StringBuilder();
                for (int i = 0; i < users.Count; i++)
                {
                    sb.Append("<a href=\"UserEdit.aspx?ID=");
                    sb.Append(users[i].UserID);
                    sb.Append("\" ");
                    if (users[i].AccountStatus != AccountStatus.Authenticated)
                    {
                        sb.Append("style=\"color:#888\" title=\"被锁定\" ");
                    }
                    sb.Append(">");
                    sb.Append(users[i].UserName);
                    sb.Append("</a>;&nbsp;");
                }
                ltUsers.Text = sb.ToString();
            }
        }
        catch (Exception ex)
        {
            base.ExecuteJs("msg('" + ex.Message + "')", false);
        }
    }
コード例 #8
0
    /// <summary>
    /// 绑定信息
    /// </summary>
    public void BindData()
    {
        int     productID = Convert.ToInt32(Request.QueryString["ProductID"]);
        Product product   = Products.GetProduct(productID);

        if (product == null)
        {
            throw new HHException(ExceptionType.ProductNotFound);
        }
        else
        {
            // 根据产品ID和公司ID查找产品供应信息
            ProductSupply ps = ProductSupplyManager.GetProductSupply(product.ProductID, Profile.AccountInfo.CompanyID);

            if (ps == null)
            {
                throw new HHException(ExceptionType.ProductSupplyNotFound);
            }
            else
            {
                // 产品名称
                lblProductName.Text = product.ProductName;

                // TODO: 产品型号

                // 最短供货时间
                txtDeliverySpan.DateSpanValue = ps.DeliverySpan;

                // 产品保修期
                txtWarrantySpan.DateSpanValue = ps.WarrantySpan;

                // 供货单价
                txtQuotePrice.Text = ps.QuotePrice.HasValue ? ps.QuotePrice.Value.ToString() : string.Empty;

                // 最小订货量
                txtQuoteMOQ.Text = ps.QuoteMOQ.HasValue ? ps.QuoteMOQ.Value.ToString() : string.Empty;

                // 包含运费
                ilIncludeFreight.SelectedValue = ps.IncludeFreight.HasValue ? (PriceIncludeType)ps.IncludeFreight : PriceIncludeType.Include;

                // 包含税
                ilIncludeTax.SelectedValue = (PriceIncludeType)ps.IncludeTax;

                // 供货税率
                txtApplyTaxRate.Text = ps.ApplyTaxRate.ToString();

                // 供应区域
                if (ps.SupplyRegion.HasValue)
                {
                    hfRegionCode.Value = ps.SupplyRegion.Value.ToString();

                    try
                    {
                        Area a = Areas.GetArea(ps.SupplyRegion.Value);
                        txtRegion.Text = a.RegionName;
                    }
                    catch { }
                }

                // 报价起始日期
                if (ps.QuoteFrom == GlobalSettings.MinValue)
                {
                    txtQuoteFrom.Text = string.Empty;
                }
                else
                {
                    txtQuoteFrom.Text = ps.QuoteFrom.ToString("yyyy年MM月dd日");
                }

                // 报价截止日期
                if (ps.QuoteEnd == GlobalSettings.MaxValue)
                {
                    txtQuoteEnd.Text = string.Empty;
                }
                else
                {
                    txtQuoteEnd.Text = ps.QuoteEnd.ToString("yyyy年MM月dd日");
                }

                // 报价自动续期周期
                txtQuoteRenewal.Text = ps.QuoteRenewal.ToString();

                // 是否启用
                csSupplyStatus.SelectedValue = ps.SupplyStatus;
            }
        }
    }