public void UDB() { DataSet ds = dbs.GetSqlDataSet("select id,UserID,UserName from GroupUsers where gid=" + Request.QueryString["id"].ToString()); TXTStation.Text = dbs.ExeSqlScalar("select station from GroupType where id=" + Request.QueryString["id"].ToString()); BDUser.DataSource = ds.Tables[0]; BDUser.DataBind(); }
protected void Page_Load(object sender, EventArgs e) { if (!IsPostBack) { if (Session["UserID"] == null) { X.AddScript("loginWindow.show();Panel1.disable();"); return; } else { ScriptManager.RegisterStartupScript(this, GetType(), "", "$('div.gn_person ul.q-menubox li:eq(0) a').text('" + Session["UserName"].ToString() + "');", true); X.AddScript("loginWindow.hide();Panel1.enable();"); DataSet ds = DIMERCO.SDK.Utilities.LSDK.getUserProfilebyUserList(Session["UserID"].ToString()); if (ds.Tables[0].Rows.Count > 0) { LBUserID.Text = ds.Tables[0].Rows[0]["userID"].ToString(); LBUserName.Text = ds.Tables[0].Rows[0]["fullName"].ToString(); LBStation.Text = ds.Tables[0].Rows[0]["StationCode"].ToString(); LBMail.Text = ds.Tables[0].Rows[0]["eMail"].ToString(); LBMail.Text = ds.Tables[0].Rows[0]["email"].ToString(); LBTel.Text = ds.Tables[0].Rows[0]["Tel"].ToString(); LBMobile.Text = ds.Tables[0].Rows[0]["Mobilephone"].ToString(); LBDepartmentCode.Text = ds.Tables[0].Rows[0]["CRPDepartmentName"].ToString(); Coststation.Text = ds.Tables[0].Rows[0]["CostCenter"].ToString(); int sct = int.Parse(dbs.ExeSqlScalar("select count(*) from StationRole where UserID='" + Session["UserID"].ToString() + "' and admin='1'")); if (sct > 0) { LBStations.Text = "Administrator"; } else { LBStations.Text = dbs.ExeSqlScalar("select Stations from StationRole where UserID='" + Session["UserID"].ToString() + "'"); } string moduleids = dbs.ExeSqlScalar("select ModuleID from StationRole where UserID='" + Session["UserID"].ToString() + "'"); if (moduleids == "") { LBModules.Text = "报销申请,报销审批,影音管理"; } else { string ModuleNames = "报销申请,报销审批,影音管理,"; DataSet dsss = dbs.GetSqlDataSet("select ModuleName from ModuleManage where id in(0" + moduleids + "0)"); for (int i = 0; i < dsss.Tables[0].Rows.Count; i++) { ModuleNames = ModuleNames + dsss.Tables[0].Rows[i]["ModuleName"].ToString() + ","; } LBModules.Text = ModuleNames; } } } } }
public void DBGroup() { string Station = Session["Station"].ToString(); if (DLStation.Value != null) { Station = DLStation.Value.ToString(); } string sql = "select id,station,GroupName,Remark from GroupType where station='" + Station + "'"; if (Session["TSQSLM"] != null && DLStation.Value == null) { sql = Session["TSQSLM"].ToString(); } DataSet ds = dbs.GetSqlDataSet(sql); Session["TSQSLM"] = sql; Store1.DataSource = ds.Tables[0]; this.Store1.DataBind(); }
protected void button1_Search(object sender, DirectEventArgs e) { DataTable tbb; string stationsss = ""; string Nct = dbs.ExeSqlScalar("select top 1 admin from StationRole where UserID='" + Session["UserID"].ToString() + "'").ToString(); if (Nct == "1") { DataSet ds = DIMERCO.SDK.Utilities.LSDK.getStationHierarchy(); //SqlConnection cn = new SqlConnection("Data Source=10.130.40.20;Initial Catalog=ReSM;User ID=sa;Password=dim1rc0@"); //SqlDataAdapter da = new SqlDataAdapter("select distinct StationCode from SMStation order by StationCode", cn); //DataSet ds = new DataSet(); //da.Fill(ds); for (int i = 0; i < ds.Tables[0].Rows.Count; i++) { stationsss = stationsss + "'" + ds.Tables[0].Rows[i]["StationCode"].ToString() + "',"; } } else { string Tstations = dbs.ExeSqlScalar("select Stations from StationRole where UserID='" + Session["UserID"].ToString() + "'"); DataTable Dt = new DataTable(); Dt.Columns.Add("StationCode"); string[] Sp = Tstations.Split(','); for (int i = 0; i < Sp.Length; i++) { if (Sp[i].ToString().Trim() != "") { stationsss = stationsss + "'" + Sp[i].ToString() + "',"; } } } DataSet dss = dbs.GetSqlDataSet("select * from ESUser where station in (" + stationsss + "'0')"); Store1.DataSource = dss.Tables[0]; Store1.DataBind(); }
public void DDB() { DataSet Mds = dbs.GetSqlDataSet("select id,ModuleName from ModuleManage"); for (int i = 0; i < Mds.Tables[0].Rows.Count; i++) { Ext.Net.Checkbox C1 = new Ext.Net.Checkbox(); C1.ID = Mds.Tables[0].Rows[i]["ID"].ToString(); C1.BoxLabel = Mds.Tables[0].Rows[i]["ModuleName"].ToString(); int Tct = int.Parse(dbs.ExeSqlScalar("select count(*) from StationRole where UserID='" + Request.QueryString["Uid"].ToString() + "' and charindex('," + Mds.Tables[0].Rows[i]["id"].ToString() + ",',ModuleID)>0")); if (Tct > 0) { C1.Checked = true; } ChkGrp.Items.Add(C1); } }
public void DBB() { string TTstation = ""; string TTyears = ""; if (DLStation.Value == null && Session["TTstation"] != null) { TTstation = Session["TTstation"].ToString(); TTyears = Session["TTyears"].ToString(); } if (DLStation.Value != null) { TTstation = DLStation.Value.ToString(); TTyears = DLYears.Value.ToString(); Session["TTstation"] = DLStation.Value.ToString(); Session["TTyears"] = DLYears.Value.ToString(); } if (DLStation.Value == null && Session["TTstation"] != null) { DLStation.Value = TTstation; DLYears.Value = TTyears; } DataTable dt = new DataTable(); dt.Columns.Add(new DataColumn("sort", typeof(string))); dt.Columns.Add(new DataColumn("my", typeof(string))); dt.Columns.Add(new DataColumn("main", typeof(string))); dt.Columns.Add(new DataColumn("code", typeof(string))); dt.Columns.Add(new DataColumn("des", typeof(string))); dt.Columns.Add(new DataColumn("m1", typeof(string))); dt.Columns.Add(new DataColumn("m2", typeof(string))); dt.Columns.Add(new DataColumn("m3", typeof(string))); dt.Columns.Add(new DataColumn("m4", typeof(string))); dt.Columns.Add(new DataColumn("m5", typeof(string))); dt.Columns.Add(new DataColumn("m6", typeof(string))); dt.Columns.Add(new DataColumn("m7", typeof(string))); dt.Columns.Add(new DataColumn("m8", typeof(string))); dt.Columns.Add(new DataColumn("m9", typeof(string))); dt.Columns.Add(new DataColumn("m10", typeof(string))); dt.Columns.Add(new DataColumn("m11", typeof(string))); dt.Columns.Add(new DataColumn("m12", typeof(string))); dt.Columns.Add(new DataColumn("tt", typeof(string))); dt.Columns.Add(new DataColumn("Type", typeof(string))); dt.Columns.Add(new DataColumn("id", typeof(string))); DataSet ds = dbs.GetSqlDataSet("select *,(m1+m2+m3+m4+m5+m6+m7+m8+m9+m10+m11+m12) as TT from BudgetMain where station='" + TTstation + "' AND YEARS='" + TTyears + "'"); int k = 0; for (int i = 0; i < ds.Tables[0].Rows.Count; i++) { string main = ds.Tables[0].Rows[i]["AccountCode"].ToString() + "/" + ds.Tables[0].Rows[i]["AccountDes"].ToString(); DataRow mdr = dt.NewRow(); mdr["id"] = ds.Tables[0].Rows[i]["id"].ToString(); mdr["sort"] = k.ToString(); mdr["my"] = "0"; mdr["main"] = main; mdr["code"] = ds.Tables[0].Rows[i]["AccountCode"].ToString(); mdr["des"] = ds.Tables[0].Rows[i]["AccountDes"].ToString();; mdr["m1"] = ds.Tables[0].Rows[i]["m1"].ToString(); mdr["m2"] = ds.Tables[0].Rows[i]["m2"].ToString(); mdr["m3"] = ds.Tables[0].Rows[i]["m3"].ToString(); mdr["m4"] = ds.Tables[0].Rows[i]["m4"].ToString(); mdr["m5"] = ds.Tables[0].Rows[i]["m5"].ToString(); mdr["m6"] = ds.Tables[0].Rows[i]["m6"].ToString(); mdr["m7"] = ds.Tables[0].Rows[i]["m7"].ToString(); mdr["m8"] = ds.Tables[0].Rows[i]["m8"].ToString(); mdr["m9"] = ds.Tables[0].Rows[i]["m9"].ToString(); mdr["m10"] = ds.Tables[0].Rows[i]["m10"].ToString(); mdr["m11"] = ds.Tables[0].Rows[i]["m11"].ToString(); mdr["m12"] = ds.Tables[0].Rows[i]["m12"].ToString(); mdr["tt"] = ds.Tables[0].Rows[i]["TT"].ToString(); mdr["Type"] = ds.Tables[0].Rows[i]["Type"].ToString(); dt.Rows.Add(mdr); DataSet dss = dbs.GetSqlDataSet("select distinct SAccoundcode,SAccoundName from BudgetDetail where fid='" + ds.Tables[0].Rows[i]["id"].ToString() + "'"); if (dss.Tables[0].Rows.Count == 0) { k = k + 1; } for (int j = 0; j < dss.Tables[0].Rows.Count; j++) { k = k + 1; DataRow dr = dt.NewRow(); dr["sort"] = k.ToString(); dr["my"] = "1"; dr["main"] = main; dr["id"] = "0"; dr["code"] = dss.Tables[0].Rows[j]["SAccoundcode"].ToString(); dr["Type"] = ds.Tables[0].Rows[i]["type"].ToString(); dr["des"] = dss.Tables[0].Rows[j]["SAccoundName"].ToString(); string saccountcode = dss.Tables[0].Rows[j]["SAccoundcode"].ToString(); double Stotal = 0; for (int m = 1; m < 13; m++) { string samount = dbs.ExeSqlScalar("select sum(Amount) from BudgetDetail where Months=" + m + " and fid='" + ds.Tables[0].Rows[i]["id"].ToString() + "' and SAccoundcode='" + saccountcode + "'"); string mid = "m" + m.ToString(); if (samount != "") { dr[mid] = samount; Stotal = Stotal + double.Parse(samount); } else { dr[mid] = "0.00"; } } dr["tt"] = Stotal.ToString(); dt.Rows.Add(dr); } if (dss.Tables[0].Rows.Count > 0) { k = k + 1; DataRow tdr = dt.NewRow(); tdr["sort"] = k.ToString(); tdr["my"] = "1"; tdr["main"] = main; tdr["id"] = "0"; tdr["code"] = ""; tdr["Type"] = ds.Tables[0].Rows[i]["type"].ToString(); tdr["des"] = "The balance"; double ttamount = 0; for (int q = 1; q < 13; q++) { string mq = "m" + q.ToString(); double tms = jdouble(lastamout(q.ToString(), ds.Tables[0].Rows[i]["id"].ToString())); ttamount = ttamount + tms; tdr[mq] = Convert.ToString(double.Parse(ds.Tables[0].Rows[i][mq].ToString()) - tms); } tdr["tt"] = Convert.ToString(double.Parse(ds.Tables[0].Rows[i]["tt"].ToString()) - ttamount); dt.Rows.Add(tdr); k = k + 1; } } //GridView1.DataSource = dt; //GridView1.DataBind(); Store2.DataSource = dt; Store2.DataBind(); }
protected void BTN_Search(object sender, DirectEventArgs e) { if (DLStation.Value == null) { X.Msg.Show(new MessageBoxConfig { Title = "Message", Message = "Please select station", Buttons = MessageBox.Button.OK, Width = 320, Icon = MessageBox.Icon.INFO }); } else { DataSet ds = DIMERCO.SDK.Utilities.LSDK.getUserDataBYStationCodeNUser(DLStation.Value.ToString().ToString(), TXTUserID.Text.Trim(), TXTUserName.Text.Trim()); // SqlConnection cn = new SqlConnection("Data Source=10.130.40.20;Initial Catalog=ReSM;User ID=sa;Password=dim1rc0@"); //string sql="select UserID,fullname from SMUser inner join SMstation on SMUser.stationid=SMstation.stationid where StationCode='"+DLStation.Value+"'"; // if(TXTUserID.Text.Trim()!="") // { // sql=sql+" and UserID='"+TXTUserID.Text.Trim()+"'"; // } // if(TXTUserName.Text.Trim()!="") // { // sql = sql + " and fullname like '%" + TXTUserName.Text.Trim() + "%'"; // } // SqlDataAdapter da = new SqlDataAdapter(sql, cn); // DataSet ds = new DataSet(); // da.Fill(ds); DataTable tb = ds.Tables[0]; DataSet dss = dbs.GetSqlDataSet("select UserID,UserName,Stations,ModuleID from StationRole where station='" + DLStation.Value + "'"); DataTable tb1 = dss.Tables[0]; DataTable ttb = new DataTable(); ttb.Columns.Add("UserID"); ttb.Columns.Add("FullName"); ttb.Columns.Add("station"); ttb.Columns.Add("ModuleName"); foreach (DataRow dr in tb.Rows) { DataRow[] drn = tb1.Select("UserID='" + dr["UserID"].ToString() + "'"); if (drn.Length > 0) { DataRow newDr = ttb.NewRow(); newDr["UserID"] = drn[0]["UserID"]; newDr["FullName"] = drn[0]["UserName"]; newDr["station"] = drn[0]["Stations"]; newDr["ModuleName"] = GetModuleName(drn[0]["ModuleID"].ToString()); ttb.Rows.Add(newDr); } else { DataRow newDr = ttb.NewRow(); newDr["UserID"] = dr["UserID"]; newDr["FullName"] = dr["fullname"]; newDr["station"] = ""; newDr["ModuleName"] = ""; ttb.Rows.Add(newDr); } } if (Session["TSQL"] != null && DLStation.Value == null) { ttb = (DataTable)Session["TSQL"]; } SVUser.DataSource = ttb; SVUser.DataBind(); Session["TSQL"] = ttb; ds.Dispose(); } }