using System; using System.Collections; using System.Collections.Generic; using System.Configuration; using System.Data; using System.Linq; using System.Web; using System.Web.Security; using System.Web.UI; using System.Web.UI.HtmlControls; using System.Web.UI.WebControls; using System.Web.UI.WebControls.WebParts; using System.Text; using DSWeb.DataAccess; using System.Data.SqlClient; using DSWeb.Models; using DSWeb.EntityDA; using System.Web.Script.Serialization; namespace DSWeb.Shipping { public partial class ExchangesUnitFinancialInfo : System.Web.UI.Page { public string strHandleType = String.Empty; public string sSQL = String.Empty; public string gvid = String.Empty; T_ALL_DA T_ALL_DA = new T_ALL_DA(); RangeDA RangeDA = new RangeDA(); public string strUserID;//用户GID protected void Page_Load(object sender, EventArgs e) { if (Session["USERID"] != null) { strUserID = Session["USERID"].ToString().Trim(); } else { Server.Transfer("~/Error/FriendError.aspx"); return; //strUserID = ""; } // if (!IsPostBack) { if (Request.QueryString["id"] != null)//if (Request.QueryString["id"] != null) { ViewState["GID"] = Request.QueryString["id"].ToString();//"topseaeusername129481962859531250"; } else { getEnabled(); } if (ViewState["GID"].ToString().Trim() !="") { DataSet ds = T_ALL_DA.GetInfoClient(" and GID='" + ViewState["GID"].ToString().Trim() + "'"); // if (ds == null) { return; } // this.hdtbBillRises.Value = ds.Tables[0].Rows[0]["DESCRIPTION"].ToString().Trim(); tbBillRises1.Text = ds.Tables[0].Rows[0]["BillRises1"].ToString().Trim(); //if (tbBillRises1.Text.Trim() == "") //{ // tbBillRises1.Text = ds.Tables[0].Rows[0]["DESCRIPTION"].ToString().Trim(); //} // tbBillRises2.Text = ds.Tables[0].Rows[0]["TaxNo"].ToString().Trim(); tbRMBBank.Text = ds.Tables[0].Rows[0]["RMBBank"].ToString().Trim(); tbRMBOnlineNO.Text = ds.Tables[0].Rows[0]["RMBOnlineNO"].ToString().Trim(); tbRMBAccount.Text = ds.Tables[0].Rows[0]["RMBAccount"].ToString().Trim(); tbUSDBank.Text = ds.Tables[0].Rows[0]["USDBank"].ToString().Trim(); tbUSDOnlineNO.Text = ds.Tables[0].Rows[0]["USDOnlineNO"].ToString().Trim(); tbUSDAccount.Text = ds.Tables[0].Rows[0]["USDAccount"].ToString().Trim(); tbRMBBillRises.Text = ds.Tables[0].Rows[0]["RMBBillRises"].ToString().Trim(); tbUSDBillRises.Text = ds.Tables[0].Rows[0]["USDBillRises"].ToString().Trim(); tbFARCODE.Text = ds.Tables[0].Rows[0]["FARCODE"].ToString().Trim(); tbFAPCODE.Text = ds.Tables[0].Rows[0]["FAPCODE"].ToString().Trim(); tbRMBMaxAmountCredit.Text = ds.Tables[0].Rows[0]["RMBMaxAmountCredit"].ToString().Trim(); tbUSDMaxAmountCredit.Text = ds.Tables[0].Rows[0]["USDMaxAmountCredit"].ToString().Trim(); tbMaxAmountCredit.Text = ds.Tables[0].Rows[0]["MaxAmountCredit"].ToString().Trim(); tbUSDExchangeRate.Text = ds.Tables[0].Rows[0]["USDExchangeRate"].ToString().Trim(); if (tbRMBMaxAmountCredit.Text.Trim().Equals("")) { tbRMBMaxAmountCredit.Text = "0"; } if (tbUSDMaxAmountCredit.Text.Trim().Equals("")) { tbUSDMaxAmountCredit.Text = "0"; } if (tbMaxAmountCredit.Text.Trim().Equals("")) { tbMaxAmountCredit.Text = "0"; } if (tbUSDExchangeRate.Text.Trim().Equals("")) { tbUSDExchangeRate.Text = "0"; } ddlSTLNAME.Text = ds.Tables[0].Rows[0]["STLNAME"].ToString().Trim(); tbSTLDATEPJ.Text = ds.Tables[0].Rows[0]["STLDATEPJ"].ToString().Trim(); if (tbSTLDATEPJ.Text.Trim().Equals("")) { tbSTLDATEPJ.Text = "1"; } tbSTLDATE.Text = ds.Tables[0].Rows[0]["STLDATE"].ToString().Trim(); tbSTLFIRSTHALFDATE.Text = ds.Tables[0].Rows[0]["STLFIRSTHALFDATE"].ToString().Trim(); tbSTLMIDDLEDATE.Text = ds.Tables[0].Rows[0]["STLMIDDLEDATE"].ToString().Trim(); } else { getEnabled(); } //权限可视范围 string strV = RangeDA.GetVISIBLERANGE(strUserID.Trim(), "modExchangesUnit"); string strO = RangeDA.GetOPERATERANGE(strUserID.Trim(), "modExchangesUnit"); string alt = ""; if (strV.Trim().Equals("1"))//分公司 { if (strO.Trim().Equals("1"))//公司 { alt = RangeDA.GetUnitCompany(strUserID.Trim(), ViewState["GID"].ToString().Trim()); if (alt == "") { getEnabled(); } } else if (strO.Trim().Equals("3"))//个人 { alt = RangeDA.GetUnitPerson(strUserID.Trim(), ViewState["GID"].ToString().Trim()); if (alt == "") { getEnabled(); } } } else if (strV.Trim().Equals("3")) { if (strO.Trim().Equals("3"))//个人 { alt = RangeDA.GetUnitPerson(strUserID.Trim(), ViewState["GID"].ToString().Trim()); if (alt == "") { getEnabled(); } } else if (strO.Trim().Equals("4"))//无 { getEnabled(); } } // } } protected void getEnabled() { ibEnter.Enabled = false; imgDel.Disabled = true; // tbBillRises1.Enabled = false; tbBillRises2.Enabled = false; tbRMBBank.Enabled = false; tbRMBOnlineNO.Enabled = false; tbRMBAccount.Enabled = false; tbUSDBank.Enabled = false; tbUSDOnlineNO.Enabled = false; tbUSDAccount.Enabled = false; tbRMBBillRises.Enabled = false; tbUSDBillRises.Enabled = false; tbFARCODE.Enabled = false; tbFAPCODE.Enabled = false; tbRMBMaxAmountCredit.Enabled = false; tbUSDMaxAmountCredit.Enabled = false; tbMaxAmountCredit.Enabled = false; tbUSDExchangeRate.Enabled = false; ddlSTLNAME.Enabled = false; tbSTLDATEPJ.Enabled = false; tbSTLDATE.Enabled = false; tbSTLFIRSTHALFDATE.Enabled = false; tbSTLMIDDLEDATE.Enabled = false; } protected void btnEnter_Click(object sender, EventArgs e) { string alt = ""; // if (tbBillRises1.Text.Trim() == "") { tbBillRises1.Text = this.hdtbBillRises.Value.Trim(); } // if (tbBillRises2.Text.Trim() == "") { tbBillRises2.Text = this.hdtbBillRises.Value.Trim(); } // if (tbRMBBillRises.Text.Trim() == "") { tbRMBBillRises.Text = this.hdtbBillRises.Value.Trim(); } // if (tbUSDBillRises.Text.Trim() == "") { tbUSDBillRises.Text = this.hdtbBillRises.Value.Trim(); } // alt = T_ALL_DA.GetInfoClientFinancialUpdate(ViewState["GID"].ToString().Trim(), tbBillRises1.Text, tbBillRises2.Text, tbRMBBank.Text, tbRMBOnlineNO.Text, tbRMBAccount.Text, tbUSDBank.Text, tbUSDOnlineNO.Text, tbUSDAccount.Text, tbRMBBillRises.Text, tbUSDBillRises.Text, tbFARCODE.Text,tbFAPCODE.Text,tbRMBMaxAmountCredit.Text, tbUSDMaxAmountCredit.Text, tbMaxAmountCredit.Text, ddlSTLNAME.Text, tbUSDExchangeRate.Text, tbSTLDATE.Text, tbSTLFIRSTHALFDATE.Text, tbSTLMIDDLEDATE.Text, tbSTLDATEPJ.Text.Trim(), strUserID.Trim()); if (alt == "") { Response.Write(""); return; } else { Response.Write(""); return; } } public bool IsNumeric(string s) { bool bReturn = true; try { int inum = int.Parse(s); } catch { bReturn = false; } return bReturn; } } }