public void AddPlanMainInfo(Fund_Plan_MonthMainInfo FI) { publicDbOpClass.ExecuteSQL(string.Format(string.Concat(new object[] { "INSERT INTO Fund_Plan_MonthMain \r\n (MonthPlanID,PrjGuid,PlanMonth,PlanYear,\r\n FlowState,Remark,OperatorCode,OperateTime,PlanType)\r\n VALUES('", FI.MonthPlanID, "','", FI.PrjGuid, "',", FI.PlanMonth, ",", FI.PlanYear, ",", FI.FlowState, ",'", FI.Remark, "','", FI.OperatorCode, "','", FI.OperateTime, "','", FI.PlanType, "')" }), new object[0])); }
protected Fund_Plan_MonthMainInfo GetMonthMainInfo() { Fund_Plan_MonthMainInfo fund_Plan_MonthMainInfo = new Fund_Plan_MonthMainInfo(); bool flag = this.FA.IsExitFundPlanMainInfo(this.plantype, this.hdfMonthPalnID.Value, this.PrjGuid.ToString()); if (flag) { fund_Plan_MonthMainInfo = this.FA.GetMainInfoByMonthPlanID(this.hdfMonthPalnID.Value); } Fund_Plan_MonthMainInfo fund_Plan_MonthMainInfo2 = new Fund_Plan_MonthMainInfo(); fund_Plan_MonthMainInfo2.MonthPlanID = new Guid(this.hdfMonthPalnID.Value); fund_Plan_MonthMainInfo2.PrjGuid = this.PrjGuid; if (!string.IsNullOrEmpty(this.txtPlanMonth.Text.Trim())) { DateTime dateTime = Convert.ToDateTime(this.txtPlanMonth.Text); fund_Plan_MonthMainInfo2.PlanYear = dateTime.Year; fund_Plan_MonthMainInfo2.PlanMonth = dateTime.Month; } fund_Plan_MonthMainInfo2.OperatorCode = base.UserCode; fund_Plan_MonthMainInfo2.OperateTime = Convert.ToDateTime(this.txtadddate.Text.Trim()); fund_Plan_MonthMainInfo2.PlanType = this.plantype; fund_Plan_MonthMainInfo2.FlowState = (flag ? fund_Plan_MonthMainInfo.FlowState : -1); fund_Plan_MonthMainInfo2.Remark = this.txtRemark.Text.Trim(); return(fund_Plan_MonthMainInfo2); }
public Fund_Plan_MonthMainInfo GetMainInfoByMonthPlanID(string MonthPlanID) { Fund_Plan_MonthMainInfo info = new Fund_Plan_MonthMainInfo(); StringBuilder builder = new StringBuilder(); builder.Append("select MonthPlanID,PrjGuid,PlanMonth,PlanYear,FlowState,Remark,OperatorCode,OperateTime,PlanType "); builder.Append(" ,(SELECT top 1 [v_xm] FROM [PT_yhmc] where [v_yhdm]=M.OperatorCode) as yhmc "); builder.Append(" ,(SELECT top 1 [PrjName] FROM [PT_prjinfo] where [PrjGuid]=M.PrjGuid) as PrjName "); builder.Append(" FROM Fund_Plan_MonthMain M"); builder.Append(" where MonthPlanID='" + MonthPlanID + "' "); DataTable table = publicDbOpClass.DataTableQuary(builder.ToString()); if (table.Rows.Count > 0) { info.MonthPlanID = new Guid(table.Rows[0]["MonthPlanID"].ToString()); info.FlowState = Convert.ToInt32(table.Rows[0]["FlowState"].ToString()); info.OperatorCode = table.Rows[0]["OperatorCode"].ToString(); info.PlanType = table.Rows[0]["PlanType"].ToString(); info.OperateTime = DateTime.Parse(table.Rows[0]["OperateTime"].ToString()); info.PlanMonth = int.Parse(table.Rows[0]["PlanMonth"].ToString()); info.PlanYear = int.Parse(table.Rows[0]["PlanYear"].ToString()); info.PrjGuid = new Guid(table.Rows[0]["PrjGuid"].ToString()); info.PrjName = table.Rows[0]["PrjName"].ToString(); info.OperatorName = table.Rows[0]["yhmc"].ToString(); info.Remark = table.Rows[0]["Remark"].ToString(); } return(info); }
public void getMonthPlanMainInfo(DateTime dtime) { Fund_Plan_MonthMainInfo fund_Plan_MonthMainInfo = new Fund_Plan_MonthMainInfo(); fund_Plan_MonthMainInfo.PrjGuid = this.PrjGuid; fund_Plan_MonthMainInfo.PlanType = this.plantype; fund_Plan_MonthMainInfo.PlanYear = dtime.Year; fund_Plan_MonthMainInfo.PlanMonth = dtime.Month; fund_Plan_MonthMainInfo.OperateTime = DateTime.Now; fund_Plan_MonthMainInfo.OperatorCode = base.UserCode; fund_Plan_MonthMainInfo = this.FA.GetMainInfo(fund_Plan_MonthMainInfo); this.hdfMonthPalnID.Value = fund_Plan_MonthMainInfo.MonthPlanID.ToString(); this.FileUpload1.RecordCode = fund_Plan_MonthMainInfo.MonthPlanID.ToString(); this.txtRemark.Text = fund_Plan_MonthMainInfo.Remark.ToString(); this.txtadddate.Text = fund_Plan_MonthMainInfo.OperateTime.ToString("yyyy-MM-dd"); if (fund_Plan_MonthMainInfo.OperatorName != null && fund_Plan_MonthMainInfo.OperatorName != "") { this.txtadduser.Text = fund_Plan_MonthMainInfo.OperatorName.ToString(); } else { AccountLogic accountLogic = new AccountLogic(); string userNameByUserCode = accountLogic.GetUserNameByUserCode(this.Session["yhdm"].ToString()); this.txtadduser.Text = userNameByUserCode; } DateTime t = Convert.ToDateTime(string.Concat(new object[] { DateTime.Today.Year.ToString(), '-', DateTime.Today.Month.ToString(), "-01" })); if (dtime < t) { this.hdfFlowState.Value = "10"; this.trtoolbar.Style.Add("display", "none"); this.trtoolbar2.Style.Add("display", ""); this.lbEidtTS.Text = " 不能编制过去的计划,现在是查看状态!"; } else { this.hdfFlowState.Value = fund_Plan_MonthMainInfo.FlowState.ToString(); if (fund_Plan_MonthMainInfo.FlowState > -1) { this.trtoolbar.Style.Add("display", "none"); this.trtoolbar2.Style.Add("display", ""); this.lbEidtTS.Text = " 此计划" + Common2.GetState(fund_Plan_MonthMainInfo.FlowState.ToString()) + "不能编制,现在是查看状态!"; } else { this.trtoolbar.Style.Add("display", ""); this.trtoolbar2.Style.Add("display", "none"); this.lbEidtTS.Text = ""; } } this.BindPlanDetail(); }
public bool updateMainInfo(Fund_Plan_MonthMainInfo MI) { StringBuilder builder = new StringBuilder(); builder.Append("Begin "); builder.Append("UPDATE [Fund_Plan_MonthMain] SET [Remark] = '" + MI.Remark + "' ,OperateTime=getdate(),OperatorCode='" + MI.OperatorCode + "' "); builder.Append(" WHERE MonthPlanID ='" + MI.MonthPlanID + "' ; "); builder.Append("End "); return(publicDbOpClass.NonQuerySqlString(builder.ToString())); }
public Fund_Plan_MonthMainInfo GetMainInfo(string prjId, int Year, int Month, string Plantype) { Fund_Plan_MonthMainInfo info = new Fund_Plan_MonthMainInfo(); DataTable table = publicDbOpClass.DataTableQuary(string.Format(" SELECT MonthPlanID,PrjGuid,PlanMonth,PlanYear,FlowState,Remark,\r\n OperatorCode,OperateTime,PlanType ,(SELECT top 1 [v_xm] \r\n FROM [PT_yhmc] where [v_yhdm]=M.OperatorCode) as yhmc ,(\r\n SELECT top 1 [PrjName] FROM [PT_prjinfo] where [PrjGuid]=M.PrjGuid) as PrjName\r\n FROM Fund_Plan_MonthMain M WHERE PrjGuid='{0}' AND PlanYear={1} \r\n AND PlanMonth={2} AND plantype='{3}'", new object[] { prjId, Year, Month, Plantype })); if (table.Rows.Count > 0) { info.MonthPlanID = new Guid(table.Rows[0]["MonthPlanID"].ToString()); info.PrjGuid = new Guid(table.Rows[0]["PrjGuid"].ToString()); info.PrjName = string.IsNullOrEmpty(table.Rows[0]["PrjName"].ToString()) ? string.Empty : table.Rows[0]["PrjName"].ToString(); info.FlowState = Convert.ToInt32(table.Rows[0]["FlowState"].ToString()); info.OperatorCode = string.IsNullOrEmpty(table.Rows[0]["OperatorCode"].ToString()) ? string.Empty : table.Rows[0]["OperatorCode"].ToString(); info.OperatorName = string.IsNullOrEmpty(table.Rows[0]["yhmc"].ToString()) ? string.Empty : table.Rows[0]["yhmc"].ToString(); info.OperateTime = Convert.ToDateTime(table.Rows[0]["OperateTime"]); info.Remark = table.Rows[0]["Remark"].ToString(); } return(info); }
public Fund_Plan_MonthMainInfo GetMainInfo(Fund_Plan_MonthMainInfo FI) { Fund_Plan_MonthMainInfo info = new Fund_Plan_MonthMainInfo { MonthPlanID = Guid.NewGuid(), FlowState = -1, OperateTime = FI.OperateTime, OperatorName = "", Remark = "" }; StringBuilder builder = new StringBuilder(); builder.Append("select MonthPlanID,PrjGuid,PlanMonth,PlanYear,FlowState,Remark,OperatorCode,OperateTime,PlanType "); builder.Append(" ,(SELECT top 1 [v_xm] FROM [PT_yhmc] where [v_yhdm]=M.OperatorCode) as yhmc "); builder.Append(" FROM Fund_Plan_MonthMain M"); builder.Append(string.Concat(new object[] { " where PrjGuid='", FI.PrjGuid, "' AND PlanYear=", FI.PlanYear, " AND PlanMonth=", FI.PlanMonth, " AND plantype= '", FI.PlanType, "'" })); DataTable table = publicDbOpClass.DataTableQuary(builder.ToString()); if (table.Rows.Count > 0) { info.MonthPlanID = new Guid(table.Rows[0]["MonthPlanID"].ToString()); info.FlowState = Convert.ToInt32(table.Rows[0]["FlowState"].ToString()); info.OperatorName = table.Rows[0]["yhmc"].ToString(); info.OperateTime = Convert.ToDateTime(table.Rows[0]["OperateTime"]); info.Remark = table.Rows[0]["Remark"].ToString(); if (info.FlowState == -2) { builder = new StringBuilder(); builder.Append("Begin "); builder.Append("UPDATE WF_Instance SET auditresult=-3 "); builder.Append("where auditresult=-2 and id in (SELECT ID FROM WF_Instance_Main WHERE InstanceCode='" + info.MonthPlanID + "'); "); builder.Append("UPDATE [Fund_Plan_MonthMain] SET [FlowState] = -3 "); builder.Append(" WHERE MonthPlanID ='" + info.MonthPlanID + "' and [FlowState]=-2; "); builder.Append("End "); publicDbOpClass.NonQuerySqlString(builder.ToString()); } return(info); } builder = new StringBuilder(); builder.Append("INSERT INTO Fund_Plan_MonthMain "); builder.Append(" (MonthPlanID,PrjGuid,PlanMonth,PlanYear,FlowState,OperatorCode,OperateTime,PlanType) "); builder.Append(string.Concat(new object[] { " VALUES( '", info.MonthPlanID, "','", FI.PrjGuid, "',", FI.PlanMonth, ",", FI.PlanYear, ",-1,'", FI.OperatorCode, "','", FI.OperateTime, "','", FI.PlanType, "')" })); publicDbOpClass.NonQuerySqlString(builder.ToString()); return(info); }
public void BindGv() { this.hfldPrjId.Value = this.prjId; this.hfldYear.Value = this.year; this.hfldPurchaseChecked.Value = string.Empty; Fund_Plan_MonthMainAction fund_Plan_MonthMainAction = new Fund_Plan_MonthMainAction(); if (this.hfldPrjId.Value.ToString() != "" && this.hfldYear.Value.ToString() != "") { this.setTitle(); Fund_Plan_MonthMainInfo fund_Plan_MonthMainInfo = new Fund_Plan_MonthMainInfo(); fund_Plan_MonthMainInfo.PrjGuid = new Guid(this.hfldPrjId.Value.ToString()); fund_Plan_MonthMainInfo.PlanType = this.plantype; fund_Plan_MonthMainInfo.PlanYear = Convert.ToInt32(this.hfldYear.Value.ToString()); Random random = new Random(); this.framShowDetail.Attributes["src"] = "showDetailMonthPlan.aspx?e=" + random.Next(1, 999) + "&mpid="; this.gvBudget.DataSource = fund_Plan_MonthMainAction.GetMainList(fund_Plan_MonthMainInfo); } this.gvBudget.DataBind(); }
public DataTable GetMainList(Fund_Plan_MonthMainInfo FI) { StringBuilder builder = new StringBuilder(); builder.Append("select MonthPlanID,PrjGuid,PlanMonth,PlanYear,FlowState,Remark,OperatorCode,OperateTime,PlanType, PlanDate,(SELECT top 1 [v_xm] FROM [PT_yhmc] where [v_yhdm]=M.OperatorCode) as yhmc "); builder.Append(", (SELECT SUM([PlanMoney]) FROM [Fund_Plan_MonthDetail] WHERE [MonthPlanID]=M.MonthPlanID) AS PlanMoney "); builder.Append(" ,(SELECT SUM([OldBalance]) FROM [Fund_Plan_MonthDetail] WHERE [MonthPlanID]=M.MonthPlanID) AS OldBalance "); builder.Append(" ,(SELECT SUM([thisBalance]) FROM [Fund_Plan_MonthDetail] WHERE [MonthPlanID]=M.MonthPlanID) AS thisBalance "); if (FI.PlanType == "payout") { builder.Append(",( SELECT SUM(cpp.PaymentMoney) FROM Con_Payout_Payment cpp LEFT JOIN Fund_Plan_MonthDetail fpmd ON cpp.MonthPlanUID=fpmd.UID "); builder.Append("WHERE fpmd.MonthPlanID=M.MonthPlanID AND cpp.FlowState=1) as PaymentMoney "); } else if (FI.PlanType == "income") { builder.Append(",( SELECT SUM(cip.CllectionPrice) FROM Con_Incomet_Payment cip LEFT JOIN Fund_Plan_MonthDetail fpmd ON cip.MonthPlanUID=fpmd.UID "); builder.Append("WHERE fpmd.MonthPlanID=M.MonthPlanID ) as PaymentMoney "); } builder.Append(" FROM Fund_Plan_MonthMain M"); builder.Append(string.Concat(new object[] { " where PrjGuid='", FI.PrjGuid, "' AND PlanYear=", FI.PlanYear, " AND plantype= '", FI.PlanType, "'" })); builder.Append(" Order by PlanDate Desc "); return(publicDbOpClass.DataTableQuary(builder.ToString())); }
public void BindPlanDetail() { if (this.MonthPlanID != "" && this.MonthPlanID.Length == 36) { DataTable dt = new DataTable(); Fund_Plan_MonthMainInfo fund_Plan_MonthMainInfo = new Fund_Plan_MonthMainInfo(); fund_Plan_MonthMainInfo = this.FA.GetMainInfoByMonthPlanID(this.MonthPlanID); this.ltFlowState.Text = Common2.GetState(fund_Plan_MonthMainInfo.FlowState.ToString()); this.ltadduser.Text = fund_Plan_MonthMainInfo.OperatorName.ToString(); this.ltadddate.Text = fund_Plan_MonthMainInfo.OperateTime.ToShortDateString(); if (fund_Plan_MonthMainInfo.PrjGuid.ToString() != "") { this.ltprjname.Text = fund_Plan_MonthMainInfo.PrjName.ToString(); } StringBuilder stringBuilder = new StringBuilder(); stringBuilder.Append(fund_Plan_MonthMainInfo.PlanYear.ToString()).Append("年"); stringBuilder.Append(fund_Plan_MonthMainInfo.PlanMonth.ToString()).Append("月"); stringBuilder.Append("资金"); this.plantype = fund_Plan_MonthMainInfo.PlanType; int num = fund_Plan_MonthMainInfo.PlanYear; int num2 = fund_Plan_MonthMainInfo.PlanMonth; num2--; if (num2 < 1) { num2 = 12; num--; } if (!string.IsNullOrEmpty(fund_Plan_MonthMainInfo.Remark)) { this.Literal2.Text = fund_Plan_MonthMainInfo.Remark.ToString(); } string text = string.Empty; if (fund_Plan_MonthMainInfo.PlanType == "payout") { this.hfldAdjunctPath.Value = ConfigHelper.Get("MonthPlanPayOut"); text = ConfigHelper.Get("MonthPlanPayOut"); this.showaudit1.BusiCode = "091"; dt = this.getLastPlan("payout", num2, num, fund_Plan_MonthMainInfo.PrjGuid.ToString()); stringBuilder.Append("支出"); } else { text = ConfigHelper.Get("MonthPlanIncome"); this.hfldAdjunctPath.Value = ConfigHelper.Get("MonthPlanIncome"); this.showaudit1.BusiCode = "090"; dt = this.getLastPlan("income", num2, num, fund_Plan_MonthMainInfo.PrjGuid.ToString()); stringBuilder.Append("收入"); } text += this.MonthPlanID.ToString(); string value = string.Empty; if (!string.IsNullOrEmpty(text)) { value = text; text = HttpContext.Current.Server.MapPath(text); } DirectoryUtility directoryUtility = new DirectoryUtility(text); List <Annex> annex = directoryUtility.GetAnnex(); ISerializable serializable = new JsonSerializer(); string a = serializable.Serialize <List <Annex> >(annex); StringBuilder stringBuilder2 = new StringBuilder(); if (a != "[]") { for (int i = 0; i < annex.Count; i++) { if (annex[i].Name != null && annex[i].Name.ToString() != "") { stringBuilder2.Append("<a class=\"link\" target=\"_blank\" href=\"../../Common/DownLoad.aspx?path=").Append(value).Append("/").Append(annex[i].Name.ToString()).Append("\" title=\"" + HttpContext.Current.Server.UrlDecode(annex[i].Name.ToString()) + "\" >"); stringBuilder2.Append(HttpContext.Current.Server.UrlDecode(annex[i].Name.ToString())); stringBuilder2.Append("</a> "); } } } this.Literal1.Text = stringBuilder2.ToString(); stringBuilder.Append("计划"); this.lblTitle.Text = stringBuilder.ToString(); DataTable planDetailList = this.FA.GetPlanDetailList(this.MonthPlanID, fund_Plan_MonthMainInfo.PlanType); DataTable dataTable = this.UniteDataTable(planDetailList, new DataTable { Columns = { { "sumtotal", Type.GetType("System.String") } }, Rows = { new object[] { "" } } }, "ce"); dataTable = this.JoinDataTable(dataTable, dt, "eee"); this.ViewState["sourcesTable"] = dataTable; this.gvwWebLineList.DataSource = dataTable; this.gvwWebLineList.DataBind(); string[] value2 = new string[] { dataTable.Compute("SUM(PlanMoney)", string.Empty).ToString() }; int[] index = new int[] { 9 }; GridViewUtility.AddTotalRow(this.gvwWebLineList, value2, index); } }
private void initParameterByMpid() { if (!string.IsNullOrEmpty(this.Mpid)) { Fund_Plan_MonthMainInfo fund_Plan_MonthMainInfo = new Fund_Plan_MonthMainInfo(); fund_Plan_MonthMainInfo = this.FA.GetMainInfoByMonthPlanID(this.Mpid); if (fund_Plan_MonthMainInfo != null) { new StringBuilder(); DataTable dataSource = new DataTable(); int num = fund_Plan_MonthMainInfo.PlanYear; int num2 = fund_Plan_MonthMainInfo.PlanMonth - 1; if (num2 < 1) { num--; } this._plantype = fund_Plan_MonthMainInfo.PlanType; StringBuilder stringBuilder = new StringBuilder(); if (fund_Plan_MonthMainInfo.PlanType == "payout") { this.hfldAdjunctPath.Value = ConfigHelper.Get("MonthPlanPayOut"); stringBuilder.Append(" SELECT tab.*, b.CorpName ,ISNULL((shijifasheng/nullif(Shangqi,0))*100,0) AS BL FROM ( SELECT Plandetail.*,planMain.PlanType, (SELECT isnull(SUM(PlanMoney),0) FROM Fund_Plan_MonthDetail AS d "); stringBuilder.Append(" WHERE d.ContractID=plandetail.ContractID AND d.MonthPlanID= (SELECT m.MonthPlanID FROM Fund_Plan_MonthMain AS m "); stringBuilder.Append(" WHERE m.PlanDate= DATEADD(MONTH,-1,planMain.PlanDate) AND m.PlanType=PlanMain.PlanType AND m.FlowState=1 AND m.PrjGuid=planMain.PrjGuid) ) AS Shangqi, "); stringBuilder.Append(" (SELECT isnull(SUM(pay.paymentMoney),0) FROM dbo.Con_Payout_Payment AS pay WHERE pay.FlowState=1 AND pay.MonthPlanUID IN "); stringBuilder.Append(" (SELECT pd.UID FROM Fund_Plan_MonthDetail AS pd WHERE pd.ContractID=plandetail.ContractID AND pd.MonthPlanID=(SELECT m.MonthPlanID "); stringBuilder.Append(" FROM Fund_Plan_MonthMain AS m WHERE m.PlanDate= DATEADD(MONTH,-1,planMain.PlanDate) AND m.PlanType=PlanMain.PlanType AND m.FlowState=1 AND m.PrjGuid=planMain.PrjGuid) ) ) AS shijifasheng, "); stringBuilder.Append(" (SELECT ContractName FROM Con_Payout_Contract AS cont WHERE cont.ContractID=plandetail.ContractID )AS ContractName"); stringBuilder.Append(" FROM Fund_Plan_MonthDetail AS PlanDetail LEFT JOIN Fund_Plan_MonthMain AS PlanMain ON plandetail.MonthPlanID=PlanMain.MonthPlanID) AS tab "); stringBuilder.Append(" LEFT JOIN Con_Payout_Contract con ON con.contractid=tab.contractid"); stringBuilder.Append(" LEFT JOIN XPM_Basic_ContactCorp b ON b.corpid=con.bName"); } else { if (fund_Plan_MonthMainInfo.PlanType == "income") { this.hfldAdjunctPath.Value = ConfigHelper.Get("MonthPlanIncome"); stringBuilder.Append(" SELECT tab.*, CON.Second AS CorpName ,ISNULL((shijifasheng/nullif(Shangqi,0))*100,0) AS BL FROM ( SELECT Plandetail.*,planMain.PlanType, (SELECT isnull(SUM(PlanMoney),0) FROM Fund_Plan_MonthDetail AS d "); stringBuilder.Append(" WHERE d.ContractID=plandetail.ContractID AND d.MonthPlanID= (SELECT m.MonthPlanID FROM Fund_Plan_MonthMain AS m "); stringBuilder.Append(" WHERE m.PlanDate= DATEADD(MONTH,-1,planMain.PlanDate) AND m.PlanType=PlanMain.PlanType AND m.FlowState=1 AND m.PrjGuid=planMain.PrjGuid) ) AS Shangqi, "); stringBuilder.Append(" (SELECT isnull(SUM(pay.CllectionPrice),0) FROM dbo.Con_Incomet_Payment AS pay WHERE pay.MonthPlanUID IN "); stringBuilder.Append(" (SELECT pd.UID FROM Fund_Plan_MonthDetail AS pd WHERE pd.ContractID=plandetail.ContractID AND pd.MonthPlanID=(SELECT m.MonthPlanID "); stringBuilder.Append(" FROM Fund_Plan_MonthMain AS m WHERE m.PlanDate= DATEADD(MONTH,-1,planMain.PlanDate) AND m.PlanType=PlanMain.PlanType AND m.FlowState=1 AND m.PrjGuid=planMain.PrjGuid) ) ) AS shijifasheng, "); stringBuilder.Append(" (SELECT ContractName FROM Con_Incomet_Contract AS cont WHERE cont.ContractID=plandetail.ContractID )AS ContractName "); stringBuilder.Append(" FROM Fund_Plan_MonthDetail AS PlanDetail LEFT JOIN Fund_Plan_MonthMain AS PlanMain ON plandetail.MonthPlanID=PlanMain.MonthPlanID) AS tab "); stringBuilder.Append("\tLEFT JOIN Con_Incomet_Contract AS CON ON CON.contractid=tab.contractid "); } } stringBuilder.Append(string.Concat(new object[] { " where PlanType='", fund_Plan_MonthMainInfo.PlanType, "' and MonthPlanID='", fund_Plan_MonthMainInfo.MonthPlanID, "' " })); dataSource = publicDbOpClass.DataTableQuary(stringBuilder.ToString()); this.gvMonthPlanList.DataSource = dataSource; this.gvMonthPlanList.DataBind(); } this.Literal1.Text = ""; return; } this.showGV.Visible = false; string text = string.Empty; text += "<table class=\"gvdata\" cellspacing=\"0\" rules=\"all\" border=\"1\" id=\"emptyMonthPlanType\" style=\"width: 100%; border-collapse: collapse;\">"; text += "<tr class=\"header\">"; text += "<th scope=\"col\" style=\"width: 20px;\">"; text += "序号"; text += "</th> "; text += "<th scope=\"col\" style=\"width:100px;\">"; text += "合同名称"; text += "</th> "; text += "<th scope=\"col\" style=\"width: 80px;\">"; text += "上期计划金额"; text += "</th>"; if (this.plantype == "payout") { text += "<th scope=\"col\" style=\"width: 80px;\">"; text += "上期实际发生金额<img title=\"=合同上期计划已通过资金支付申请审核金额\" style=\"cursor: pointer;\" src=\"/images/help.jpg\" />"; text += "</th>"; text += "<th scope=\"col\" style=\"width: 80px;\">"; text += "上期计划执行完成情况<img title=\"=上期实际发生金额/上期计划金额\" style=\"cursor: pointer;\" src=\"/images/help.jpg\" />"; text += "</th>"; } else { text += "<th scope=\"col\" style=\"width: 80px;\">"; text += "上期实际发生金额<img title=\"=合同上期计划已回款金额\" style=\"cursor: pointer;\" src=\"/images/help.jpg\" />"; text += "</th>"; text += "<th scope=\"col\" style=\"width: 80px;\">"; text += "上期计划执行完成情况<img title=\"=上期实际发生金额/上期计划金额\" style=\"cursor: pointer;\" src=\"/images/help.jpg\" />"; text += "</th>"; } text += "<th scope=\"col\" style=\"width: 80px;\">"; text += "本期计划金额"; text += "</th> "; text += "<th scope=\"col\" style=\"width: 30px;\">"; text += "附件"; text += "</th>"; text += "<th scope=\"col\">"; text += "备注"; text += "</th>"; text += "</tr>"; text += "</table>"; this.Literal1.Text = text; }
public void getMonthPlanInfo() { DateTime dateTime = Convert.ToDateTime(this.QueryDateCtrl1.Month + "-01"); this.hdnYear.Value = dateTime.Year.ToString(); this.hdnMonth.Value = dateTime.Month.ToString(); string text = string.Empty; this.hfplantype.Value = this.plantype; if (this.plantype == "payout") { this.FileUpload1.Class = "MonthPlanPayOut"; text = "支出"; } else { if (this.plantype == "income") { this.FileUpload1.Class = "MonthPlanIncome"; text = "收入"; } } this.FileUpload1.RecordCode = this.hdfMonthPalnID.Value; this.lblTitle.Text = string.Concat(new string[] { this.prjName, " ", dateTime.ToString("yyyy年MM月"), "资金", text, "计划" }); bool flag = false; if (!string.IsNullOrEmpty(this.hdfMonthPalnID.Value)) { flag = this.FA.IsExitFundPlanMainInfo(this.plantype, this.hdfMonthPalnID.Value, this.PrjGuid.ToString()); } if (flag) { Fund_Plan_MonthMainInfo mainInfoByMonthPlanID = this.FA.GetMainInfoByMonthPlanID(this.hdfMonthPalnID.Value); this.txtPlanMonth.Text = string.Concat(new object[] { mainInfoByMonthPlanID.PlanYear, "年", mainInfoByMonthPlanID.PlanMonth, "月" }); this.txtProName.Value = mainInfoByMonthPlanID.PrjName; this.hdfcontrcn.Value = mainInfoByMonthPlanID.PrjGuid.ToString(); this.txtadduser.Text = mainInfoByMonthPlanID.OperatorName; this.hdfMonthPalnID.Value = mainInfoByMonthPlanID.MonthPlanID.ToString(); this.txtadddate.Text = Common2.GetTime(mainInfoByMonthPlanID.OperateTime); this.txtRemark.Text = mainInfoByMonthPlanID.Remark; } else { this.txtPlanMonth.Text = dateTime.ToString("yyyy年MM月"); this.txtProName.Value = this.prjName; AccountLogic accountLogic = new AccountLogic(); this.txtadduser.Text = accountLogic.GetUserNameByUserCode(this.Session["yhdm"].ToString()); this.txtadddate.Text = Common2.GetTime(DateTime.Now); } this.BindPlanDetail(); }
protected void btnEdit_Click(object sender, EventArgs e) { string arg_05_0 = string.Empty; MonthDetailLogic monthDetailLogic = new MonthDetailLogic(); int num = 0; using (SqlConnection sqlConnection = new SqlConnection(SqlHelper.ConnectionString)) { sqlConnection.Open(); SqlTransaction sqlTransaction = sqlConnection.BeginTransaction(); for (int i = 0; i < this.gvwWebLineList.Rows.Count; i++) { MonthDetailModel monthDetailModel = new MonthDetailModel(); ClientScriptManager arg_40_0 = this.Page.ClientScript; monthDetailModel.UID = new Guid(this.gvwWebLineList.DataKeys[i].Value.ToString()); monthDetailModel.MonthPlanID = new Guid(this.hdfMonthPalnID.Value); HtmlInputText htmlInputText = this.gvwWebLineList.Rows[i].FindControl("txtOrderID") as HtmlInputText; if (htmlInputText.Value != "" && htmlInputText.Value != "0") { monthDetailModel.OrderID = new int?(Convert.ToInt32(htmlInputText.Value.ToString())); } else { monthDetailModel.OrderID = new int?(i + 1); } HiddenField hiddenField = this.gvwWebLineList.Rows[i].FindControl("hidenContractID") as HiddenField; if (!(hiddenField.Value.ToString() != "")) { num = 0; break; } monthDetailModel.ContractID = hiddenField.Value.ToString(); monthDetailModel.Plansubject = ""; HtmlInputText htmlInputText2 = this.gvwWebLineList.Rows[i].FindControl("txtOldBalance") as HtmlInputText; if (htmlInputText2.Value.ToString() != "") { monthDetailModel.OldBalance = new decimal?(decimal.Parse(htmlInputText2.Value.ToString())); } else { monthDetailModel.OldBalance = new decimal?(0m); } HtmlInputText htmlInputText3 = this.gvwWebLineList.Rows[i].FindControl("txtPlanMoney") as HtmlInputText; if (htmlInputText3.Value.ToString() != "") { monthDetailModel.PlanMoney = new decimal?(decimal.Parse(htmlInputText3.Value.ToString())); } else { monthDetailModel.PlanMoney = new decimal?(0m); } HtmlInputText htmlInputText4 = this.gvwWebLineList.Rows[i].FindControl("txtRemark") as HtmlInputText; if (htmlInputText4.Value.ToString() != "") { monthDetailModel.ReMark = htmlInputText4.Value.ToString(); } else { monthDetailModel.ReMark = ""; } if (monthDetailLogic.Update(monthDetailModel, sqlTransaction)) { num = 1; } } if (num == 1) { sqlTransaction.Commit(); Fund_Plan_MonthMainInfo fund_Plan_MonthMainInfo = new Fund_Plan_MonthMainInfo(); fund_Plan_MonthMainInfo.MonthPlanID = new Guid(this.hdfMonthPalnID.Value); fund_Plan_MonthMainInfo.OperatorCode = base.UserCode; fund_Plan_MonthMainInfo.Remark = this.txtRemark.Text.ToString().Trim(); this.FA.updateMainInfo(fund_Plan_MonthMainInfo); StringBuilder stringBuilder = new StringBuilder(); stringBuilder.Append("btnEdit_onclick();"); base.RegisterScript(stringBuilder.ToString()); } else { sqlTransaction.Rollback(); StringBuilder stringBuilder2 = new StringBuilder(); stringBuilder2.Append("btnEdit_onclick();"); base.RegisterScript(stringBuilder2.ToString()); } } }
protected void btnSave_Click(object sender, EventArgs e) { string text = string.Empty; int num = 0; using (SqlConnection sqlConnection = new SqlConnection(SqlHelper.ConnectionString)) { sqlConnection.Open(); SqlTransaction sqlTransaction = sqlConnection.BeginTransaction(); for (int i = 0; i < this.gvwWebLineList.Rows.Count; i++) { MonthDetailModel monthDetailModel = new MonthDetailModel(); monthDetailModel.ThisBalance = new decimal?(0m); monthDetailModel.UID = new Guid(this.gvwWebLineList.DataKeys[i].Value.ToString()); monthDetailModel.MonthPlanID = new Guid(this.hdfMonthPalnID.Value); monthDetailModel.OrderID = new int?(0); HiddenField hiddenField = this.gvwWebLineList.Rows[i].FindControl("hidenContractID") as HiddenField; if (!string.IsNullOrEmpty(hiddenField.Value.Trim())) { if (this.findInfoByContractID(hiddenField.Value.ToString(), monthDetailModel.UID.ToString())) { text += "依据合同已存在!"; num = 0; break; } monthDetailModel.ContractID = hiddenField.Value.ToString(); } monthDetailModel.Plansubject = string.Empty; HtmlInputText htmlInputText = this.gvwWebLineList.Rows[i].FindControl("txtOldBalance") as HtmlInputText; monthDetailModel.OldBalance = new decimal?(string.IsNullOrEmpty(htmlInputText.Value.Trim()) ? 0m : decimal.Parse(htmlInputText.Value)); HtmlInputText htmlInputText2 = this.gvwWebLineList.Rows[i].FindControl("txtPlanMoney") as HtmlInputText; monthDetailModel.PlanMoney = new decimal?(string.IsNullOrEmpty(htmlInputText2.Value.Trim()) ? 0m : decimal.Parse(htmlInputText2.Value.Trim())); HtmlInputText htmlInputText3 = this.gvwWebLineList.Rows[i].FindControl("txtConRemark") as HtmlInputText; monthDetailModel.ReMark = (string.IsNullOrEmpty(htmlInputText3.Value.Trim()) ? string.Empty : htmlInputText3.Value.Trim()); if (!string.IsNullOrEmpty(monthDetailModel.ContractID)) { if (monthDetailModel.PlanMoney < 1m) { num = 2; text = "计划金额应大于0"; break; } if (this.findInfoByUID(monthDetailModel.UID.ToString())) { if (this.bll.Add(monthDetailModel)) { num = 1; } } else { if (this.bll.Update(monthDetailModel, sqlTransaction)) { num = 1; } } } } if (num == 1) { sqlTransaction.Commit(); Fund_Plan_MonthMainInfo monthMainInfo = this.GetMonthMainInfo(); monthMainInfo.MonthPlanID = new Guid(this.hdfMonthPalnID.Value); monthMainInfo.OperatorCode = base.UserCode; monthMainInfo.Remark = this.txtRemark.Text.ToString().Trim(); if (this.FA.IsExitFundPlanMainInfo(monthMainInfo.PlanType, monthMainInfo.MonthPlanID.ToString(), monthMainInfo.PrjGuid.ToString())) { this.FA.updateMainInfo(monthMainInfo); } else { this.FA.AddPlanMainInfo(monthMainInfo); } base.RegisterScript("top.ui.tabSuccess({ parentName: '_Flowclass' });"); this.BindPlanDetail(); } else { sqlTransaction.Rollback(); base.RegisterScript("top.ui.alert('保存失败! " + text + "')"); } } }
public void BindPlanDetail() { this.mpid.Value = this.hdfMonthPalnID.Value; Fund_Plan_MonthMainInfo mainInfoByMonthPlanID = this.FA.GetMainInfoByMonthPlanID(this.hdfMonthPalnID.Value); int num = mainInfoByMonthPlanID.PlanMonth; int num2 = mainInfoByMonthPlanID.PlanYear; DataTable dataTable = new DataTable(); if (this.plantype == "payout") { Fund_MonthPlanSet.pathLine = "MonthPlanPayOut"; dataTable = this.FA.GetPlanDetailAboutPayout(this.hdfMonthPalnID.Value, string.Empty); num--; num2 = mainInfoByMonthPlanID.PlanYear; if (num < 1) { num2--; num = 12; } } else { if (this.plantype == "income") { Fund_MonthPlanSet.pathLine = "MonthPlanIncome"; dataTable = this.FA.GetPlanDetailAboutIncomet(this.hdfMonthPalnID.Value, string.Empty); num--; if (num < 1) { num2--; num = 12; } } } DataTable lastPlan = this.getLastPlan(this.plantype, num, num2); dataTable.Columns.Add("pathLine", Type.GetType("System.String")); if (dataTable.Rows.Count > 0) { dataTable = this.UniteDataTable(dataTable, lastPlan, "newtable"); } else { this.HiddenField1.Value = "1"; } this.ViewState["temDT"] = dataTable; object arg_153_0 = this.ViewState["temDT"]; dataTable = (this.ViewState["temDT"] as DataTable); if (dataTable.Rows.Count < 1) { DataRow dataRow = dataTable.NewRow(); dataRow["UID"] = Guid.NewGuid(); dataRow["MonthPlanID"] = this.hdfMonthPalnID.Value; dataRow["ContractID"] = ""; dataRow["Plansubject"] = ""; dataRow["PlanMoney"] = "0.00"; dataRow["OldBalance"] = "0.00"; dataRow["OrderID"] = "-1"; dataRow["ReMark"] = ""; dataRow["ThisBalance"] = "0.00"; dataTable.Rows.Add(dataRow); } this.gvwWebLineList.DataSource = dataTable; this.gvwWebLineList.DataBind(); if (this.gvwWebLineList.Rows.Count > 0 && this.lbEidtTS.Text.Trim() == "") { this.btnSave.Enabled = true; return; } this.btnSave.Enabled = false; }