public static void WritToDB(object state) { try { List <XElement> list = XElement.Load(AppDomain.CurrentDomain.BaseDirectory + "AppSettings.config").Elements("add").ToList <XElement>(); BasicConfigService service = new BasicConfigService(); foreach (XElement element in list) { string name = element.Attribute("key").Value; string str3 = element.Attribute("value").Value; BasicConfig byName = service.GetByName(name); if (byName != null) { byName.ParaValue = str3; service.Update(byName); } else { byName = new BasicConfig { Id = Guid.NewGuid().ToString(), ParaName = name, ParaValue = str3 }; service.Add(byName); } } } catch { } }
public static void ClearTotal2(object o) { Log4netHelper.Error(new Exception("clearTotal2 开始执行"), "clearTotal2", "bery"); BasicConfigService service = new BasicConfigService(); BasicConfig byName = service.GetByName("IsClearTaskTotal2"); if (byName.ParaValue != "1") { try { BudTaskService service2 = new BudTaskService(); BudModifyTaskService source = new BudModifyTaskService(); new PTPrjInfoService(); foreach (BudModifyTask task in source.ToList <BudModifyTask>()) { source.UpdateTotal2(task.ModifyTaskId); } string cmdText = string.Format("\r\n\t\t\t\t\tSELECT TaskId FROM Bud_Task\r\n\t\t\t\t\tWHERE TaskId IN ( SELECT TaskId FROM Bud_TaskResource )\r\n\t\t\t\t", new object[0]); DataTable table = SqlHelper.ExecuteQuery(CommandType.Text, cmdText, new SqlParameter[0]); for (int i = 0; i < table.Rows.Count; i++) { string taskId = table.Rows[i][0].ToString(); service2.UpdateTotal2(taskId); } byName.ParaValue = "1"; service.Update(byName); Log4netHelper.Error(new Exception("clearTotal2 执行成功"), "clearTotal2", "bery"); } catch (Exception exception) { Log4netHelper.Error(exception, "clearTotal2", "bery"); } } }
protected void Button1_ServerClick(object sender, EventArgs e) { string text = this.txtpass.Text.Trim().ToString(); if (!(base.Request.QueryString["tt"].ToString() == "1")) { try { BasicConfigService basicConfigService = new BasicConfigService(); BasicConfig byName = basicConfigService.GetByName("TheDeletePwd"); byName.ParaValue = text; basicConfigService.Update(byName); string script = "\r\n\t\t\t\t\t<script>\r\n\t\t\t\t\t\ttop.ui.show( '设置成功!');\r\n\t\t\t\t\t</script>\r\n\t\t\t\t"; base.ClientScript.RegisterStartupScript(base.GetType(), Guid.NewGuid().ToString(), script); } catch { string script2 = "\r\n\t\t\t\t\t<script>\r\n\t\t\t\t\t\ttop.ui.show( '设置失败!');\r\n\t\t\t\t\t</script>\r\n\t\t\t\t"; base.ClientScript.RegisterStartupScript(base.GetType(), Guid.NewGuid().ToString(), script2); } return; } bool twoPWD = myxml.GetTwoPWD(text); BasicConfigService basicConfigService2 = new BasicConfigService(); basicConfigService2.GetValue("TheDeletePwd"); if (twoPWD) { this.Session["twopass"] = "******"; base.ClientScript.RegisterStartupScript(base.GetType(), Guid.NewGuid().ToString(), "<script>window.opener=null;window.close(this);</script>"); return; } base.ClientScript.RegisterStartupScript(base.GetType(), Guid.NewGuid().ToString(), "<script>alert('密码错误!');</script>"); }
protected void DataBinds() { BasicConfigService basicConfigService = new BasicConfigService(); // //ifkt crossTime string crossTime = basicConfigService.GetValue("crossTime"); //是否跨天的标记 string overtime = basicConfigService.GetValue("overtime"); //是否加班的标记 string strCT = "2018-03-26 " + crossTime; string strOT = "2018-03-26 " + overtime; int currentPageIndex = this.AspNetPager1.CurrentPageIndex; string str = ((pagesize * (currentPageIndex - 1)) + 1).ToString(); string str2 = (pagesize * currentPageIndex).ToString(); DataTable dtA = pcSer.GetMsgTable(strWhere(), UserCode); foreach (DataRow dr in dtA.Rows) { string strA = "2018-03-26 " + dr["t1"].ToString(); string strB = "2018-03-26 " + dr["t2"].ToString(); if (Convert.ToDateTime(strA) > Convert.ToDateTime(strCT) && Convert.ToDateTime(strB) > Convert.ToDateTime(strCT)) { dr["ifkt"] = "1"; } else { dr["ifkt"] = "0"; } string strA1 = "2018-03-26 " + dr["t1"].ToString(); string strB1 = "2018-03-26 " + dr["t2"].ToString(); if (Convert.ToDateTime(strA1) > Convert.ToDateTime(strOT) && Convert.ToDateTime(strB1) > Convert.ToDateTime(strOT)) { dr["ifjb"] = "1"; } else { dr["ifjb"] = "0"; } } DataRow[] rows = dtA.Select(" pageindex >=" + str + " and pageindex<=" + str2); DataTable dtB = dtA.Clone(); foreach (DataRow row in rows) { dtB.Rows.Add(row.ItemArray); } this.AspNetPager1.PageSize = NBasePage.pagesize; this.AspNetPager1.RecordCount = dtA.Rows.Count; this.GvList.DataSource = dtB; this.GvList.DataBind(); }
protected void Page_Load(object sender, EventArgs e) { if (!this.Page.IsPostBack) { BasicConfigService basicConfigService = new BasicConfigService(); this.hfldPwd.Value = basicConfigService.GetValue("TheDeletePwd"); if (this.Type == 0) { this.btnViewWF.Style["display"] = "none"; this.btnWFPrint.Style["display"] = "none"; return; } int arg_71_0 = this.ISdel; this.btnViewWF.Style["display"] = ""; this.btnWFPrint.Style["display"] = ""; } }
protected void btnSaveWX_ServerClick(object sender, System.EventArgs e) { BasicConfigService basicConfigService = new BasicConfigService(); string strIF = basicConfigService.GetValue("ifMoreBudget"); //需求时,是否可超预算 0不可以 1可以 if (strIF == "0") { int ii = 0; if (this.gvSmWantPlanStock.Rows.Count > 0) { System.Collections.Generic.List <MaterialPlanStockModel> list = new System.Collections.Generic.List <MaterialPlanStockModel>(); System.Collections.Generic.Dictionary <string, decimal> dictionary = new System.Collections.Generic.Dictionary <string, decimal>(); foreach (GridViewRow gridViewRow in this.gvSmWantPlanStock.Rows) { TextBox txtNumber = (TextBox)gridViewRow.FindControl("txtNumber"); Label ResourceQuantity = (Label)gridViewRow.FindControl("ResourceQuantity"); Label numberIng = (Label)gridViewRow.FindControl("numberIng"); Decimal num = System.Convert.ToDecimal(txtNumber.Text); //需求数量 Decimal rq = System.Convert.ToDecimal(ResourceQuantity.Text); //预算数量 Decimal ni = System.Convert.ToDecimal(numberIng.Text); //在途数量 //在途+需求 >预算 if ((ni + num) > rq) { ii++; } } } if (ii > 0) { StringBuilder stringBuilder = new StringBuilder(); stringBuilder.Append("alert('需求时,不能超预算数量!');"); base.RegisterScript(stringBuilder.ToString()); } else { save("wx"); } } else { save("wx"); } }
protected void Page_Load(object sender, System.EventArgs e) { base.Response.Cache.SetNoStore(); string value = base.Request["tid"]; if (!this.Page.IsPostBack) { if (base.Request["type"] != null) { this.hdfNodeValue.Value = base.Request.QueryString["type"]; value = this.hdfNodeValue.Value; } this.Tree_Bind(); BasicConfigService basicConfigService = new BasicConfigService(); this.hfldPwd.Value = basicConfigService.GetValue("TheDeletePwd"); this.KeepTreeViewState(); } if (!string.IsNullOrEmpty(value)) { this.HdnTemplateID.Value = value; DataTable dataTable = FlowTemplateAction.QueryOneTemplate(System.Convert.ToInt32(value)); if (dataTable.Rows.Count > 0) { this.HdnBusinessClass.Value = dataTable.Rows[0]["Businessclass"].ToString(); } this.BindView(base.UserCode, System.Convert.ToInt32(value)); } if (this.ViewState["tid"] != null) { this.BindView(base.UserCode, System.Convert.ToInt32(this.ViewState["tid"].ToString())); } this.btnAdd.Attributes["onclick"] = "javascript:if(!OpenWin('add')) return false;"; this.btnEdit.Attributes["onclick"] = "javascript:if(!OpenWin('upd')) return false;"; this.btnDel.Attributes["onclick"] = "javascript:if(!confirm('确定删除该项吗?')) return false;"; this.btnWFPrint.Attributes["onclick"] = "OpenPrintWF('999');"; this.btnStartWFRecord.Attributes["onclick"] = "openAudit('999')"; this.BtnView.Attributes["onclick"] = "OpenLock();"; }
public static void ClearPTPrjInfo(object o) { try { Log4netHelper.Error(new Exception("ClearPTPrjInfo 开始执行"), "ClearPTPrjInfo", "bery"); BasicConfigService service = new BasicConfigService(); BasicConfig byName = service.GetByName("IsClearPTPrjInfo"); if (byName == null) { byName = new BasicConfig { Id = Guid.NewGuid().ToString(), ParaName = "IsClearPTPrjInfo", ParaValue = "0", Note = "是否已经把PT_PrjInfo_ZTB表的数据导入PT_PrjInfo表中" }; service.Add(byName); } if (byName.ParaValue != "1") { string cmdText = "SELECT PrjGuid FROM PT_PrjInfo_ZTB WHERE PrjGuid Not IN (SELECT PrjGuid FROM PT_PrjInfo)"; foreach (DataRow row in SqlHelper.ExecuteQuery(CommandType.Text, cmdText, new SqlParameter[0]).Rows) { Guid id = new Guid(row[0].ToString()); PTPrjInfoZTBService service2 = new PTPrjInfoZTBService(); PTPrjInfoService service3 = new PTPrjInfoService(); PTPrjInfoZTB byId = service2.GetById(id); service3.ChangePrjInfo(byId, 2, 1); } byName.ParaValue = "1"; service.Update(byName); } } catch (Exception exception) { Log4netHelper.Error(exception, "ClearPTPrjInfo", "bery"); } }
protected void BtnAdd_Click(object sender, System.EventArgs e) { if (this.ddltTemplate.SelectedValue == "-1") { base.RegisterScript("top.ui.alert('请选择流程模板')"); return; } WFInstanceMainService wFInstanceMainService = new WFInstanceMainService(); WFTemplateNodeService wFTemplateNodeService = new WFTemplateNodeService(); if (wFTemplateNodeService.GetNodes(this.TemplateID).Count == 0) { wFInstanceMainService.UpdateBusinessData(this.RecordID.ToString(), this.BusinessCode, 1); WFBusinessCodeService wFBusinessCodeService = new WFBusinessCodeService(); WFBusinessCode byId = wFBusinessCodeService.GetById(this.BusinessCode); string path = base.Server.MapPath("~/SelfEventInfo.xml"); string typeName = SelfEventAction.GetTypeName(path, byId.LinkTable, byId.StateField); if (!string.IsNullOrEmpty(typeName)) { ISelfEvent selfEvent = (ISelfEvent)System.Reflection.Assembly.Load("PmBusinessLogic").CreateInstance(typeName); if (selfEvent != null) { System.Threading.ThreadPool.QueueUserWorkItem(new System.Threading.WaitCallback(selfEvent.CommitEvent), this.RecordID.ToString()); } } if (this.BusinessCode == "089") { PTPrjInfoZTB byId2 = this.ptInfoZTbSer.GetById(this.RecordID); this.ptInfoZTbSer.UpdatePrjState(byId2, new int?(2)); } else { if (this.BusinessCode == "100") { PrjMember.AddLimit(this.RecordID); } else { if (this.BusinessCode == "107") { Progress.UpdateLatest(this.RecordID.ToString()); } else { if (this.BusinessCode == "108") { cn.justwin.BLL.ProgressManagement.Version.UpdateLatest(this.RecordID.ToString()); } } } } base.RegisterScript("top.ui.winSuccess({parentName: '_StartWf'}); top.ui.show('审核通过'); "); return; } if (wFInstanceMainService.IsReSubmit(this.RecordID.ToString(), this.BusinessCode)) { this.Page.ClientScript.RegisterStartupScript(base.GetType(), "", "top.ui.alert('当前数据已经被提交,禁止二次提交');", true); return; } if (this.ddltTemplate.SelectedValue != "-1") { FlowChartAction.display_FlowChart(this.tbFlowChart, this.TemplateID); if (this.txtReceiver.Text != "") { if (this.TemplateID == 0) { this.Page.ClientScript.RegisterStartupScript(base.GetType(), "", "top.ui.alert('请选择流程模板');", true); return; } string[] array = new string[3]; this.TemplateID = System.Convert.ToInt32(this.hdnTemplateID.Value); if (this.TemplateCount > 1) { array = FlowAuditAction.GetOffsetNodeFirst(this.TemplateID, this.BusinessClass, this.RecordID); this.hdnNodeId.Value = array[0].ToString(); this.hdnOrderNumber.Value = array[1].ToString(); } else { if (this.TemplateCount == 1) { if (this.OffsetCount > 1) { this.hdnNodeId.Value = this.NodeID.ToString(); this.hdnOrderNumber.Value = "1"; } else { array = FlowAuditAction.GetOffsetNodeFirst(this.TemplateID, this.BusinessClass, this.RecordID); this.hdnNodeId.Value = array[0].ToString(); this.hdnOrderNumber.Value = array[1].ToString(); } } } int offsetorder = System.Convert.ToInt32(this.hdnOrderNumber.Value.ToString().Trim()); this.NodeID = System.Convert.ToInt32(this.hdnNodeId.Value.ToString().Trim()); if (this.hdnNodeId.Value.Trim() == "0") { this.JS.Text = "top.ui.alert('工作流程多分支模板未设置分支条件!');"; return; } if (this.Type.Value != "") { FlowAuditAction.UpdateNode(this.hdnReceiver.Value, this.TemplateID); } if (FlowAuditAction.BeginFlow(this.BusinessClass, this.BusinessCode, this.RecordID, this.TemplateID, this.NodeID, offsetorder, this.ProjectCode, this.UserCode)) { try { BasicConfigService basicConfigService = new BasicConfigService(); string WXTX = basicConfigService.GetValue("WXTX");//是否微信提醒 if (WXTX == "1") { DataTable dataTable = publicDbOpClass.DataTableQuary("select * from wf_templatenode where templateid=" + this.TemplateID + " and frontnode=0"); DataTable dataTable2 = publicDbOpClass.DataTableQuary(string.Concat(new string[] { "select businessclassname from wf_business_class where businesscode='", this.BusinessCode, "' and businessclass='", this.BusinessClass, "'" })); if (dataTable.Rows.Count > 0) { string text2 = dataTable.Rows[0]["Operater"].ToString(); string text = dataTable2.Rows[0][0].ToString(); //给执行人、相关人 发送微信消息 //WXAPI.sendWeChatMsg(this.UserID.Value.ToString(), hfldTo.Value.ToString(), hfldCopyto.Value.ToString(), "task", this.KeyId.Value, title.Value.ToString(), DateTime.Now.ToString()); WXAPI.sendWeChatMsg(this.UserCode, text2, "", "wf", "", text, DateTime.Now.ToString()); } } // //if (ConfigHelper.Get("SMS") != "") //{ // DataTable dataTable = publicDbOpClass.DataTableQuary("select * from wf_templatenode where templateid=" + this.TemplateID + " and frontnode=0"); // DataTable dataTable2 = publicDbOpClass.DataTableQuary(string.Concat(new string[] // { // "select businessclassname from wf_business_class where businesscode='", // this.BusinessCode, // "' and businessclass='", // this.BusinessClass, // "'" // })); // if (dataTable.Rows.Count > 0) // { // string text = dataTable2.Rows[0][0].ToString(); // if (dataTable.Rows[0]["isselreceiver"].ToString() == "1") // { // SMS sMS = new SMS(); // string mbNo = new PhoozyanHelpAction().RePhoneCode(this.hdnReceiver.Value); // string msg = string.Concat(new string[] // { // "公司短信:", // this.txtReceiver.Text, // "您好!", // new CommunicationAction().BackUserName(this.UserCode), // "已发起", // text, // "流程,请您查看审核!" // }); // if (!(bool)sMS.Send("", mbNo, msg, "", "", "")[0]) // { // } // } // else // { // string arg = ""; // System.Collections.ArrayList arrayList = new System.Collections.ArrayList(); // System.Collections.ArrayList arrayList2 = new System.Collections.ArrayList(); // string text2 = dataTable.Rows[0]["Operater"].ToString(); // if (text2.Contains(",")) // { // string[] array2 = text2.Split(new char[] // { // ',' // }); // for (int i = 0; i < array2.Length - 1; i++) // { // new userManageDb().GetUserName(array2[i]); // arrayList.Add(arrayList); // string value = new PhoozyanHelpAction().RePhoneCode(array2[i]); // arrayList2.Add(value); // } // for (int j = 0; j < arrayList.Count; j++) // { // if (!string.IsNullOrEmpty(arrayList2[j].ToString())) // { // string msg2 = string.Concat(new object[] // { // "公司短信:", // arrayList[j], // "您好!", // new CommunicationAction().BackUserName(this.UserCode), // "已发起", // text, // "流程,请您查看审核!" // }); // SMS sMS2 = new SMS(); // if (!(bool)sMS2.Send("", arrayList2[j].ToString(), msg2, "", "", "")[0]) // { // arg += arrayList[j]; // } // } // else // { // arg = arg + arrayList[j] + " "; // } // } // } // else // { // string text3 = new CommunicationAction().BackUserName(dataTable.Rows[0][0].ToString()); // DataTable dataTable3 = publicDbOpClass.DataTableQuary("select mobilephonecode from pt_yhmc where v_yhdm='" + dataTable.Rows[0]["Operater"].ToString() + "'"); // if (dataTable3.Rows.Count > 0) // { // string mbNo2 = dataTable3.Rows[0][0].ToString(); // if (dataTable2.Rows.Count > 0) // { // string msg3 = string.Concat(new string[] // { // "公司短信:", // text3, // "您好!", // new CommunicationAction().BackUserName(this.UserCode), // "已发起", // text, // "流程,请您查看审核!" // }); // SMS sMS3 = new SMS(); // bool arg_85F_0 = (bool)sMS3.Send("", mbNo2, msg3, "", "", "")[0]; // } // } // } // } // } //} } catch { } if (!string.IsNullOrEmpty(base.Request["purl"])) { base.RegisterScript("top.ui.winSuccess({parentName: '_StartWf'}); top.ui.show('工作流程已成功启动'); "); return; } base.RegisterScript("top.ui.winSuccess({parentName: '_StartWf'}); top.ui.show('工作流程已成功启动'); "); return; } else { base.ClientScript.RegisterStartupScript(base.GetType(), "myalert", "<script type='text/javascript'>alert('请找管理员设置 " + this.ddltTemplate.SelectedItem.Text.ToString() + " 流程的负责人。')</script>", false); } } } }
protected void btnSave_ServerClick(object sender, System.EventArgs e) { BasicConfigService basicConfigService = new BasicConfigService(); string strIF = basicConfigService.GetValue("ifMoreBudget"); //需求时,是否可超预算 0不可以 1可以 if (strIF == "0") { int ii = 0; if (this.gvSmWantPlanStock.Rows.Count > 0) { System.Collections.Generic.List <MaterialPlanStockModel> list = new System.Collections.Generic.List <MaterialPlanStockModel>(); System.Collections.Generic.Dictionary <string, decimal> dictionary = new System.Collections.Generic.Dictionary <string, decimal>(); try { foreach (GridViewRow gridViewRow in this.gvSmWantPlanStock.Rows) { TextBox txtNumber = (TextBox)gridViewRow.FindControl("txtNumber"); Label ResourceQuantity = (Label)gridViewRow.FindControl("ResourceQuantity"); Label numberIng = (Label)gridViewRow.FindControl("numberIng"); string strNum = txtNumber.Text.ToString().Trim(); //需求数量 string strRQ = ResourceQuantity.Text.ToString().Trim(); //预算数量 string strNI = numberIng.Text.ToString().Trim(); //在途数量 Decimal num = 0; Decimal rq = 0; Decimal ni = 0; if (!string.IsNullOrEmpty(strNum)) { num = System.Convert.ToDecimal(txtNumber.Text); //需求数量 } if (!string.IsNullOrEmpty(strRQ)) { rq = System.Convert.ToDecimal(ResourceQuantity.Text);//预算数量 } if (!string.IsNullOrEmpty(strNI)) { ni = System.Convert.ToDecimal(numberIng.Text); //在途数量 } if ((ni + num) > rq && !string.IsNullOrEmpty(strRQ) && !string.IsNullOrEmpty(strNI)) { // txtNumber.Font.Bold = true; txtNumber.ForeColor = Color.FromName("#FF7D00"); // ResourceQuantity.Font.Bold = true; // ResourceQuantity.ForeColor = Color.FromName("#FF7D00"); //numberIng.Font.Bold = true; //numberIng.ForeColor = Color.FromName("#FF7D00"); ii++; } } } catch { ii = 0; } } if (ii > 0) { StringBuilder stringBuilder = new StringBuilder(); stringBuilder.Append("alert('需求时,不能超预算数量!');"); base.RegisterScript(stringBuilder.ToString()); } else { save("pc"); } } else { save("pc"); } }