private void IniPage() { try { BLL.SupplierImport imp = new SupplierImport(); this.lblFieldDesc.Text = imp.GetDefineFieldDesc(); //取所有的系统类别及其全名 QueryAgent qa = new Rms.ORMap.QueryAgent(); try { DataTable tbAllSystemGroup = qa.ExecSqlForDataSet("select dbo.GetSystemGroupFullName(GroupCode) as FullName, * from SystemGroup where ClassCode = '1401'").Tables[0]; Session["tbAllSystemGroup"] = tbAllSystemGroup; } finally { qa.Dispose(); } } catch (Exception ex) { ApplicationLog.WriteLog(this.ToString(), ex, ""); Response.Write(JavaScript.Alert(true, "初始化页面出错:" + ex.Message)); } }
protected void btnCheckDelete_ServerClick(object sender, EventArgs e) { try { QueryAgent qa = new Rms.ORMap.QueryAgent(); DataSet ds = qa.ExecSqlForDataSet(string.Format("select distinct i.PaymentCode from PayoutItem a, PaymentItem i where a.PayoutCode = '{0}' and a.PaymentItemCode = i.PaymentItemCode", this.txtPayoutCode.Value)); DataTable tb = ds.Tables[0]; qa.Dispose(); BLL.PaymentRule.DeletePayout(this.txtPayoutCode.Value); //付款单审核后删除后改变请款单状态 BLL.PaymentRule.UpdatePaymentStatusByPayout(tb, base.user.UserCode); } catch (Exception ex) { ApplicationLog.WriteLog(this.ToString(), ex, ""); Response.Write(Rms.Web.JavaScript.Alert(true, "删除审核后付款单出错:" + ex.Message)); return; } GoBack(); }
private DataTable BuildingTotalGroupByPBSTypeCode(string ProjectCode) { try { QueryAgent qa = new Rms.ORMap.QueryAgent(); try { DataSet ds = qa.ExecSqlForDataSet("select PBSTypeCode, sum(isnull(Area, 0)) as Area" + ", sum(isnull(House1Count, 0) + isnull(House2Count, 0) + isnull(House3Count, 0) + isnull(House4Count, 0) + isnull(House5Count, 0)) as HouseCount" + " from V_Building where ProjectCode = '" + ProjectCode + "' group by PBSTypeCode"); return(ds.Tables[0]); } finally { qa.Dispose(); } } catch (Exception ex) { throw ex; } }
/// <summary> /// 表单元素校验 /// </summary> /// <returns>结果(false为校验通过)</returns> private bool InvalidInput() { try { bool ReturnCancel = false; if (((RmsPM.Web.UserControls.InputUnit) this.FormView1.Row.FindControl("ViseUnitTextBox")).Value == "") { ((HtmlGenericControl)this.FormView1.Row.FindControl("UnitMsgSpan")).InnerHtml = "<font color='red'>必填</font>"; ReturnCancel = true; } else { ((HtmlGenericControl)this.FormView1.Row.FindControl("UnitMsgSpan")).InnerHtml = ""; } if (((RmsPM.Web.UserControls.InputUser) this.FormView1.Row.FindControl("VisePersonTextBox")).Value == "") { ((HtmlGenericControl)this.FormView1.Row.FindControl("PersonMsgSpan")).InnerHtml = "<font color='red'>必填</font>"; ReturnCancel = true; } else { ((HtmlGenericControl)this.FormView1.Row.FindControl("PersonMsgSpan")).InnerHtml = ""; } if (((RmsPM.Web.UserControls.InputSystemGroup) this.FormView1.Row.FindControl("InputSystemGroup")).Value == "") { ((HtmlGenericControl)this.FormView1.Row.FindControl("SystemGroupSpan")).InnerHtml = "<font color='red'>必填</font>"; ReturnCancel = true; } else { ((HtmlGenericControl)this.FormView1.Row.FindControl("SystemGroupSpan")).InnerHtml = ""; } //签证编号不能重复 string sql = ""; if (FormView1.CurrentMode == FormViewMode.Insert) { sql = "select visecode,viseid from localevise where viseproject='" + _projectCode + "'"; } else if (FormView1.CurrentMode == FormViewMode.Edit) { sql = "select visecode,viseid from localevise where visecode!=" + Convert.ToInt32(FormView1.DataKey.Value.ToString() + "") + " and viseproject='" + _projectCode + "'"; } Rms.ORMap.QueryAgent qa = new Rms.ORMap.QueryAgent(); DataSet ds = qa.ExecSqlForDataSet(sql); qa.Dispose(); TextBox txtViseID; if (FormView1.CurrentMode == FormViewMode.Insert) { txtViseID = ((TextBox)this.FormView1.Row.FindControl("ViseIdTextBox")); foreach (DataRow dr in ds.Tables[0].Rows) { if (dr["viseid"].ToString().Trim() == txtViseID.Text.Trim()) { Response.Write(Rms.Web.JavaScript.Alert(true, "签证编号重复")); ReturnCancel = true; break; } } } if (FormView1.CurrentMode == FormViewMode.Edit) { txtViseID = ((TextBox)this.FormView1.Row.FindControl("ViseIdTextBox")); foreach (DataRow dr in ds.Tables[0].Rows) { if (dr["viseid"].ToString().Trim() == txtViseID.Text.Trim()) { Response.Write(Rms.Web.JavaScript.Alert(true, "签证编号重复")); ReturnCancel = true; break; } } } return(ReturnCancel); } catch (Exception ex) { RmsPM.Web.LogHelper.Error(ex.ToString()); Response.Write(Rms.Web.JavaScript.Alert(true, "表单元素校验出错:" + ex.Message)); return(false); } }