protected void btnEdit_Click(object obj, EventArgs e) { if (c == null) { int id = int.Parse(Request.QueryString["ID"]); c = Companys.GetCompany(id); } c.CompanyName = txtCompanyName.Text.Trim(); c.CompanyRegion = int.Parse(hfRegionCode.Value); c.Phone = txtCompanyPhone.Text.Trim(); c.Fax = txtCompanyFax.Text.Trim(); c.Address = txtCompanyAddress.Text.Trim(); c.Zipcode = txtZipCode.Text.Trim(); c.Website = txtCompanyWebsite.Text.Trim(); c.Orgcode = txtOrgCode.Text.Trim(); c.Regcode = txtIcpCode.Text.Trim(); c.Remark = txtCompanyMemo.Text.Trim(); c.CompanyStatus = cslMain.SelectedValue; c.UpdateTime = DateTime.Now; c.UpdateUser = Profile.AccountInfo.UserID; bool result = Companys.UpdateCompany(c); if (result) { base.ExecuteJs("msg('操作成功,已成功修改公司信息!',true);", false); } else { base.ExecuteJs("msg('操作失败,无法修改公司信息!',false);", false); } }
protected void Button13_Click(object sender, EventArgs e) { Company company = Companys.GetCompany("CompanyName"); if (company != null) { lblTip.Text = company.CreateTime.ToString(); } }
public void egvCorps_RowDeleting(object sender, GridViewDeleteEventArgs e) { int id = (int)egvCorps.DataKeys[e.RowIndex].Value; Company c = Companys.GetCompany(id); c.CompanyStatus = CompanyStatus.Lockon; Companys.UpdateCompany(c); BindCorps(); }
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>"); }
protected void egvPendings_RowDataBound(object sender, GridViewRowEventArgs e) { if (e.Row.RowType == DataControlRowType.DataRow) { Literal lt1 = e.Row.Cells[0].FindControl("ltCompanyName") as Literal; Literal lt2 = e.Row.Cells[1].FindControl("ltCompanyType") as Literal; Pending p = e.Row.DataItem as Pending; Company c = Companys.GetCompany(p.CompanyID); lt1.Text = c.CompanyName; lt2.Text = GetCompanyType(c.CompanyType); } }
string GetCompanyName(int comId) { Company c = Companys.GetCompany(comId); if (c == null) { return("--"); } else { return(c.CompanyName); } }
protected void Button11_Click(object sender, EventArgs e) { Company company = Companys.GetCompany("CompanyName"); company.Remark = DateTime.Now.ToString(); if (Companys.UpdateCompany(company)) { lblTip.Text = "Update Success"; } else { lblTip.Text = "Update Fail"; } }
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); }
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>; "); } ltUsers.Text = sb.ToString(); } } catch (Exception ex) { base.ExecuteJs("msg('" + ex.Message + "')", false); } }