protected void button1_Search(object sender, DirectEventArgs e) { if (DLStation.Value == null || DLStation.Value.ToString() == "" || TextField1.Text == "") { X.Msg.Show(new MessageBoxConfig { Title = "Message", Message = "Please select Station and input Group Name.", Buttons = MessageBox.Button.OK, Width = 320, Icon = MessageBox.Icon.INFO }); } else { string sql = " insert into GroupType(station,GroupName,Remark,CreatedBy,CreatedDate) values ('" + DLStation.Value.ToString() + "','" + TextField1.Text + "','" + TextField4.Text + "','" + Session["UserName"].ToString() + "','" + DateTime.Now.ToString() + "') "; int r = dbs.ExeSql(sql); if (r > 0) { DataSet ds = dbs.GetSqlDataSet("select id,station,GroupName,Remark from GroupType where station='" + DLStation.Value.ToString() + "'"); Store1.DataSource = ds.Tables[0]; this.Store1.DataBind(); X.Msg.Show(new MessageBoxConfig { Title = "Message", Message = "Save success", Buttons = MessageBox.Button.OK, Width = 320, Icon = MessageBox.Icon.INFO }); } else { X.Msg.Show(new MessageBoxConfig { Title = "Message", Message = "Save Faile", Buttons = MessageBox.Button.OK, Width = 320, Icon = MessageBox.Icon.INFO }); } } }
protected void BTN_AddUser(object sender, DirectEventArgs e) { int cc = int.Parse(dbs.ExeSqlScalar("select count(*) from GroupFlow where type='" + Request.QueryString["M"].ToString() + "' and Gid=" + Request.QueryString["id"].ToString() + " and FlowNo=" + DLStep.Value)); if (cc <= 0) { if (DLUser.Text.Trim() != "") { string uid = DLUser.Value.ToString(); if (DLUser.SelectedItem.Text.ToString() == "Paul Lee") { uid = "A0104"; } dbs.ExeSql("insert into GroupFlow(Gid,FlowNo,FlowUser,FlowUserID,Type,Fn) values(" + Request.QueryString["id"].ToString() + "," + DLStep.Value + ",'" + DLUser.SelectedItem.Text + "','" + uid + "','" + Request.QueryString["M"].ToString() + "','" + ff.Value + "')"); } else { X.Msg.Show(new MessageBoxConfig { Title = "Message", Message = "Please input Approver ID", Buttons = MessageBox.Button.OK, Width = 320, Icon = MessageBox.Icon.INFO }); } } else { X.Msg.Show(new MessageBoxConfig { Title = "Message", Message = "The flow No. is exist", Buttons = MessageBox.Button.OK, Width = 320, Icon = MessageBox.Icon.INFO }); } DB(); }
public void LoadBudget() { int ct = int.Parse(dbs.ExeSqlScalar("select count(*) from BudgetMain where Station='" + DLStation.Text + "' and Years='" + DLYears.Text + "'")); if (ct <= 0) { if (DLStation.Text.ToString().Trim() != "") { string WebServiceUrl = System.Configuration.ConfigurationManager.AppSettings["WebserviceURL"].ToString(); ServiceReference1.BudgetApplicationSoapClient objService = new ServiceReference1.BudgetApplicationSoapClient("BudgetApplicationSoap", WebServiceUrl); DataSet Budgetds = objService.GetBudgetPackage(DLStation.Text.ToString(), int.Parse(DLYears.Text.ToString()), "BudgetPackageToken"); string sql = "set xact_abort on BEGIN TRAN "; for (int i = 0; i < Budgetds.Tables[0].Rows.Count; i++) { DataRow dr = Budgetds.Tables[0].Rows[i]; string baccountcode = dbs.ExeSqlScalar("select BAccountCode from AccoundCode where SAccountCode='" + dr["AccountCode"].ToString() + "'"); sql = sql + " insert into BudgetMain(BaacountCode,Station,Years,AccountCode,AccountDes,M1,M2,M3,M4,M5,M6,M7,M8,M9,M10,M11,M12,type)"; sql = sql + "Values ('" + baccountcode + "','" + DLStation.Text.ToString() + "'," + DLYears.Text.ToString() + ",'" + dr["AccountCode"].ToString() + "','" + dr["AccountDesc"].ToString() + "'," + JDnull(dr["bJAN"].ToString()) + "," + JDnull(dr["bFEB"].ToString()) + "," + JDnull(dr["bMAR"].ToString()) + "," + JDnull(dr["bAPR"].ToString()) + "," + JDnull(dr["bMAY"].ToString()) + "," + JDnull(dr["bJUN"].ToString()) + "," + JDnull(dr["bJUN1"].ToString()) + "," + JDnull(dr["bAUG"].ToString()) + "," + JDnull(dr["bSEP"].ToString()) + "," + JDnull(dr["bOCT"].ToString()) + "," + JDnull(dr["bNOV"].ToString()) + "," + JDnull(dr["bDEC"].ToString()) + ",0)"; } sql += " COMMIT TRAN"; int r = dbs.ExeSql(sql); if (r < 0) { X.Msg.Show(new MessageBoxConfig { Title = "Message", Message = "载入失败", Buttons = MessageBox.Button.OK, Width = 320, Icon = MessageBox.Icon.INFO }); } else { LoadData.Hide(); X.Msg.Show(new MessageBoxConfig { Title = "Message", Message = "载入成功", Buttons = MessageBox.Button.OK, Width = 320, Icon = MessageBox.Icon.INFO }); DBB(); } } else { X.Msg.Show(new MessageBoxConfig { Title = "Message", Message = "请选择站点", Buttons = MessageBox.Button.OK, Width = 320, Icon = MessageBox.Icon.INFO }); } } else { X.Msg.Show(new MessageBoxConfig { Title = "Message", Message = "预算已载入", Buttons = MessageBox.Button.OK, Width = 320, Icon = MessageBox.Icon.INFO }); } }
protected void BTN_Search(object sender, DirectEventArgs e) { string tcks = "0"; if (CK.Checked == true) { tcks = "1"; } if (HH.Value == "") { int r = dbs.ExeSql("insert into Eagent(Owner,OwnerID,PAgent,PAgentID,Bdate,Edate,St,CrededDate) values('" + Session["UserName"] + "','" + Session["UserID"] + "','" + DLUser.SelectedItem.Text + "','" + DLUser.Value + "','" + TXTBdate.Text + "','" + TXTEdate.Text + "','" + tcks + "','" + DateTime.Now.ToString() + "')"); DBB(); Window1.Hide(); if (r > 0) { X.Msg.Show(new MessageBoxConfig { Title = "Message", Message = "保存成功", Buttons = MessageBox.Button.OK, Width = 320, Icon = MessageBox.Icon.INFO }); } else { X.Msg.Show(new MessageBoxConfig { Title = "Message", Message = "保存失败", Buttons = MessageBox.Button.OK, Width = 320, Icon = MessageBox.Icon.INFO }); } } else { int r = dbs.ExeSql("update Eagent set PAgent='" + DLUser.SelectedItem.Text + "',PAgentID='" + DLUser.Value + "',Bdate='" + TXTBdate.Text + "',Edate='" + TXTEdate.Text + "',St='" + tcks + "',CrededDate='" + DateTime.Now.ToString() + "' where id=" + HH.Value); HH.Value = ""; DBB(); Window1.Hide(); if (r > 0) { X.Msg.Show(new MessageBoxConfig { Title = "Message", Message = "保存成功", Buttons = MessageBox.Button.OK, Width = 320, Icon = MessageBox.Icon.INFO }); } else { X.Msg.Show(new MessageBoxConfig { Title = "Message", Message = "保存失败", Buttons = MessageBox.Button.OK, Width = 320, Icon = MessageBox.Icon.INFO }); } } }
protected void copy(object sender, DirectEventArgs e) { int nm = int.Parse(LBMonths.Text) + 1; if (nm > 12) { X.Msg.Show(new MessageBoxConfig { Title = "Message", Message = "已经超过12月,不能拷贝", Buttons = MessageBox.Button.OK, Width = 320, Icon = MessageBox.Icon.INFO }); } else { string nnamount = dbs.ExeSqlScalar("select sum(amount) from BudgetDetail where fid=" + Request.QueryString["id"].ToString() + " and months=" + LBMonths.Text); if (nnamount == "") { X.Msg.Show(new MessageBoxConfig { Title = "Message", Message = "要拷贝的月份数据为空,不能拷贝", Buttons = MessageBox.Button.OK, Width = 320, Icon = MessageBox.Icon.INFO }); } else { double ctt = double.Parse(nnamount); string nmonthtt = dbs.ExeSqlScalar("select m" + nm.ToString() + " from BudgetMain where id=" + Request.QueryString["id"].ToString()); if (nmonthtt == "") { X.Msg.Show(new MessageBoxConfig { Title = "Message", Message = "下个月预算为空,不能拷贝", Buttons = MessageBox.Button.OK, Width = 320, Icon = MessageBox.Icon.INFO }); } else { if (double.Parse(nmonthtt) < double.Parse(nnamount)) { X.Msg.Show(new MessageBoxConfig { Title = "Message", Message = "下个月预算小于要拷贝的数据,不能拷贝", Buttons = MessageBox.Button.OK, Width = 320, Icon = MessageBox.Icon.INFO }); } else { int ii = dbs.ExeSql("INSERT INTO [BudgetDetail]([FID],[Months],[Name],[Amount],[Type] ,[SAccoundcode],[SAccoundName],[Deptment],[Station],[UserID],BaccountCode)select [FID],'" + nm.ToString() + "' as [Months],[Name],[Amount],[Type] ,[SAccoundcode],[SAccoundName],[Deptment],[Station],[UserID],BaccountCode from [BudgetDetail] where fid=" + Request.QueryString["id"].ToString() + " and months=" + LBMonths.Text); if (ii > 0) { LBMonths.Value = nm.ToString(); DBDetail(); X.Msg.Show(new MessageBoxConfig { Title = "Message", Message = "拷贝成功", Buttons = MessageBox.Button.OK, Width = 320, Icon = MessageBox.Icon.INFO }); } else { X.Msg.Show(new MessageBoxConfig { Title = "Message", Message = "拷贝失败", Buttons = MessageBox.Button.OK, Width = 320, Icon = MessageBox.Icon.INFO }); } } } } } }
protected void SAVE_Search(object sender, DirectEventArgs e) { string sck = ""; ChkGrp.CheckedItems.ForEach(delegate(Checkbox checkbox) { sck = sck + checkbox.BoxLabel.ToString() + ","; }); int ct = int.Parse(dbs.ExeSqlScalar("select count(*) from StationRole where UserID='" + Request.QueryString["Uid"].ToString() + "'")); if (ct > 0) { string sql = "update StationRole set Stations='" + sck + "',createdby='" + Session["UserID"].ToString() + "', createdDate='" + DateTime.Now.ToString() + "' where UserID='" + Request.QueryString["Uid"].ToString() + "'"; int r = dbs.ExeSql(sql); if (r > 0) { X.Msg.Show(new MessageBoxConfig { Title = "Message", Message = "Save success", Buttons = MessageBox.Button.OK, Width = 320, Icon = MessageBox.Icon.INFO }); } else { X.Msg.Show(new MessageBoxConfig { Title = "Message", Message = "Save Fail", Buttons = MessageBox.Button.OK, Width = 320, Icon = MessageBox.Icon.INFO }); } } else { string sql = " insert into StationRole(UserID,Stations,UserName,Admin,station,createdby,createdDate) values ('" + Request.QueryString["Uid"].ToString() + "','" + sck + "','" + Request.QueryString["Unm"].ToString() + "','0','" + Request.QueryString["S"].ToString() + "','" + Session["UserID"].ToString() + "','" + DateTime.Now.ToString() + "') "; int r = dbs.ExeSql(sql); if (r > 0) { X.Msg.Show(new MessageBoxConfig { Title = "Message", Message = "保存成功", Buttons = MessageBox.Button.OK, Width = 320, Icon = MessageBox.Icon.INFO }); } else { X.Msg.Show(new MessageBoxConfig { Title = "Message", Message = "保存失败", Buttons = MessageBox.Button.OK, Width = 320, Icon = MessageBox.Icon.INFO }); } } }
protected void BTN_Search(object sender, DirectEventArgs e) { if (HH.Value == "") { int CT = int.Parse(dbs.ExeSqlScalar("select count(*) from ESUser where Userid='" + DLUser.Value + "'")); if (CT <= 0) { int r = dbs.ExeSql("insert into ESUser(Userid,UserName,Station,Currency) values('" + DLUser.Value + "','" + DLUser.SelectedItem.Text + "','" + DLStation.SelectedItem.Text + "','" + DLCurrency.SelectedItem.Text + "')"); DBB(); Window1.Hide(); if (r > 0) { X.Msg.Show(new MessageBoxConfig { Title = "Message", Message = "保存成功", Buttons = MessageBox.Button.OK, Width = 320, Icon = MessageBox.Icon.INFO }); } else { X.Msg.Show(new MessageBoxConfig { Title = "Message", Message = "保存失败", Buttons = MessageBox.Button.OK, Width = 320, Icon = MessageBox.Icon.INFO }); } } else { X.Msg.Show(new MessageBoxConfig { Title = "Message", Message = "该用户币种表已经存在,请点击修改", Buttons = MessageBox.Button.OK, Width = 320, Icon = MessageBox.Icon.INFO }); } } else { int r = dbs.ExeSql("update ESUser set Currency='" + DLCurrency.SelectedItem.Text + "' where id=" + HH.Value); HH.Value = ""; DBB(); Window1.Hide(); if (r > 0) { X.Msg.Show(new MessageBoxConfig { Title = "Message", Message = "保存成功", Buttons = MessageBox.Button.OK, Width = 320, Icon = MessageBox.Icon.INFO }); } else { X.Msg.Show(new MessageBoxConfig { Title = "Message", Message = "保存失败", Buttons = MessageBox.Button.OK, Width = 320, Icon = MessageBox.Icon.INFO }); } } }
protected void Save(object sender, DirectEventArgs e) { int cc = int.Parse(dbs.ExeSqlScalar("select count(*) from EmailTo where station='" + DLStation.Value + "'")); if (cc == 0) { int r = dbs.ExeSql("insert into EmailTo(Station,Email,CreatedDate,CreatedBy) values('" + DLStation.Value + "','" + TXTEmail.Text + "','" + DateTime.Now.ToString() + "','" + Session["UserName"].ToString() + "')"); if (r > 0) { DLStation.Value = null; TXTEmail.Text = ""; DBB(); X.Msg.Show(new MessageBoxConfig { Title = "Message", Message = "Save success", Buttons = MessageBox.Button.OK, Width = 320, Icon = MessageBox.Icon.INFO }); } else { X.Msg.Show(new MessageBoxConfig { Title = "Message", Message = "Save Faile", Buttons = MessageBox.Button.OK, Width = 320, Icon = MessageBox.Icon.INFO }); } } else { int r = dbs.ExeSql("update EmailTo set email='" + TXTEmail.Text + "',createddate='" + DateTime.Now.ToString() + "',createdby='" + Session["UserName"].ToString() + "' where station='" + DLStation.Value + "'"); if (r > 0) { DLStation.Value = null; TXTEmail.Text = ""; DBB(); X.Msg.Show(new MessageBoxConfig { Title = "Message", Message = "Save success", Buttons = MessageBox.Button.OK, Width = 320, Icon = MessageBox.Icon.INFO }); } else { X.Msg.Show(new MessageBoxConfig { Title = "Message", Message = "Save Faile", Buttons = MessageBox.Button.OK, Width = 320, Icon = MessageBox.Icon.INFO }); } } }
public void DeleUsers(string ID) { dbs.ExeSql("Delete from GroupUsers where id=" + ID); UDB(); }