示例#1
0
        public static inputReceiptReportCollectin GetReportInfo(int PlanId, out string PlanYear)
        {
            string str;

            PlanYear = DateTime.Today.Year.ToString();
            inputReceiptReportCollectin collectin = new inputReceiptReportCollectin();
            DataTable table = publicDbOpClass.DataTableQuary(string.Format("select * from Prj_IncomeDevotionPlan where MainID={0}", PlanId));

            if (table.Rows.Count > 0)
            {
                PlanYear = table.Rows[0]["PlanYear"].ToString();
                foreach (DataRow row in publicDbOpClass.DataTableQuary(("select sum(IncomeMoney) as IncomeMoney,sum(DevotionMoney) as DevotionMoney,DepartmentName  from Prj_IncomeDevotionPlanChild where MainID=" + PlanId.ToString()) + " and DepartmentName not in (select ProjectDepName from Prj_ProjectInfo)" + " group by DepartmentName").Rows)
                {
                    str = string.Format("select v_bmmc from pt_d_bm where i_bmdm={0}", row["DepartmentName"].ToString());
                    inputReceiptReportInfo info = new inputReceiptReportInfo();
                    object obj2 = publicDbOpClass.ExecuteScalar(str);
                    if (obj2 == null)
                    {
                        info.IsProject = true;
                        object obj3 = publicDbOpClass.ExecuteScalar("select prjName from Prj_ProjectInfo where prjCode='" + row["DepartmentName"].ToString() + "'");
                        if (obj3 != null)
                        {
                            info.PrjName = obj3.ToString();
                        }
                    }
                    else
                    {
                        info.IsProject = false;
                        info.PrjName   = obj2.ToString();
                    }
                    info.InputAmount   = decimal.Parse(row["DevotionMoney"].ToString());
                    info.ReceiptAmount = decimal.Parse(row["IncomeMoney"].ToString());
                    str = ("select isnull(sum(ScienceEmpolderMoney),0)/10000 from Prj_ScienceEmpolderDevotion where year(FillTime)=" + PlanYear) + " and prjCode='" + row["DepartmentName"].ToString() + "'";
                    info.InputCompAmount = decimal.Parse(publicDbOpClass.ExecuteScalar(str).ToString());
                    str = ("select isnull(sum(ComAuditValue),0)/10000 from Prj_TechnologyAdvancementIncome where year(EndDate)=" + PlanYear) + " and prjCode='" + row["DepartmentName"].ToString() + "'";
                    info.ReceiptCompAmount = decimal.Parse(publicDbOpClass.ExecuteScalar(str).ToString());
                    collectin.Add(info);
                }
            }
            table.Dispose();
            foreach (DataRow row2 in publicDbOpClass.DataTableQuary(("select isnull(sum(ScienceEmpolderMoney),0)/10000,prjCode from Prj_ScienceEmpolderDevotion where year(FillTime)=" + PlanYear) + " and prjCode not in(select DepartmentName from Prj_IncomeDevotionPlanChild where MainID=" + PlanId.ToString() + ") group by prjCode").Rows)
            {
                inputReceiptReportInfo info2 = new inputReceiptReportInfo {
                    InputCompAmount = decimal.Parse(row2[0].ToString()),
                    IsProject       = true
                };
                str = ("select isnull(sum(ComAuditValue),0)/10000 from Prj_TechnologyAdvancementIncome where year(EndDate)=" + PlanYear) + " and prjCode='" + row2["prjCode"].ToString() + "'";
                info2.ReceiptCompAmount = decimal.Parse(publicDbOpClass.ExecuteScalar(str).ToString());
                info2.PrjName           = publicDbOpClass.ExecuteScalar("select prjName from Prj_ProjectInfo where prjCode='" + row2["prjCode"].ToString() + "'").ToString();
                DataTable table2 = publicDbOpClass.DataTableQuary("select a.PrjName,b.v_bmmc,c.* from Prj_ProjectInfo a,pt_d_bm b,Prj_IncomeDevotionPlanChild c where cast(isnull(a.projectDepName,0) as int)=b.i_bmdm and a.projectDepName=c.DepartmentName and a.PrjCode='" + row2["prjCode"].ToString() + "'");
                if (table2.Rows.Count > 0)
                {
                    info2.InputAmount   = decimal.Parse(table2.Rows[0]["DevotionMoney"].ToString());
                    info2.ReceiptAmount = decimal.Parse(table2.Rows[0]["IncomeMoney"].ToString());
                }
                table2.Dispose();
                collectin.Add(info2);
            }
            return(collectin);
        }
示例#2
0
    private void CreateDpm(inputReceiptReportInfo objInfo, bool isPrj)
    {
        HtmlTableRow htmlTableRow = new HtmlTableRow();

        this.iIndex++;
        HtmlTableCell htmlTableCell = new HtmlTableCell();

        htmlTableCell.InnerText = this.iIndex.ToString();
        htmlTableCell.Style.Add("FONT-WEIGHT", "bold");
        htmlTableRow.Cells.Add(htmlTableCell);
        HtmlTableCell htmlTableCell2 = new HtmlTableCell();

        htmlTableCell2.InnerText = objInfo.PrjName;
        htmlTableRow.Cells.Add(htmlTableCell2);
        HtmlTableCell htmlTableCell3 = new HtmlTableCell();

        htmlTableCell3.InnerText = objInfo.ReceiptAmount.ToString();
        htmlTableRow.Cells.Add(htmlTableCell3);
        HtmlTableCell htmlTableCell4 = new HtmlTableCell();

        htmlTableCell4.InnerText = objInfo.ReceiptCompAmount.ToString();
        htmlTableRow.Cells.Add(htmlTableCell4);
        HtmlTableCell htmlTableCell5 = new HtmlTableCell();

        htmlTableCell5.InnerText = objInfo.ReceiptCompRate.ToString();
        htmlTableRow.Cells.Add(htmlTableCell5);
        HtmlTableCell htmlTableCell6 = new HtmlTableCell();

        htmlTableCell6.InnerText = objInfo.InputAmount.ToString();
        htmlTableRow.Cells.Add(htmlTableCell6);
        HtmlTableCell htmlTableCell7 = new HtmlTableCell();

        htmlTableCell7.InnerText = objInfo.InputCompAmount.ToString();
        htmlTableRow.Cells.Add(htmlTableCell7);
        HtmlTableCell htmlTableCell8 = new HtmlTableCell();

        htmlTableCell8.InnerText = objInfo.InputCompRate.ToString();
        htmlTableRow.Cells.Add(htmlTableCell8);
        htmlTableRow.Height = "22";
        htmlTableRow.Attributes["onclick"]     = "doClick(this,\"tbReport\");";
        htmlTableRow.Attributes["onmouseover"] = "doMouseOver(this);";
        htmlTableRow.Attributes["onmouseout"]  = "doMouseOut(this);";
        if (isPrj)
        {
            htmlTableRow.Attributes["onclick"] = "doClick(this,\"tbReport\");controlRow();";
        }
        this.tbReport.Rows.Add(htmlTableRow);
    }
示例#3
0
    private void CreatePrjRow(int ChildIndex, inputReceiptReportInfo objInfo)
    {
        HtmlTableRow  htmlTableRow  = new HtmlTableRow();
        HtmlTableCell htmlTableCell = new HtmlTableCell();

        htmlTableCell.InnerText = this.iIndex.ToString() + "." + ChildIndex.ToString();
        htmlTableRow.ID         = ChildIndex.ToString();
        htmlTableRow.Cells.Add(htmlTableCell);
        HtmlTableCell htmlTableCell2 = new HtmlTableCell();

        htmlTableCell2.InnerHtml = "  " + objInfo.PrjName;
        htmlTableRow.Cells.Add(htmlTableCell2);
        HtmlTableCell htmlTableCell3 = new HtmlTableCell();

        htmlTableCell3.InnerText = objInfo.ReceiptAmount.ToString();
        htmlTableRow.Cells.Add(htmlTableCell3);
        HtmlTableCell htmlTableCell4 = new HtmlTableCell();

        htmlTableCell4.InnerText = objInfo.ReceiptCompAmount.ToString();
        htmlTableRow.Cells.Add(htmlTableCell4);
        HtmlTableCell htmlTableCell5 = new HtmlTableCell();

        htmlTableCell5.InnerText = objInfo.ReceiptCompRate.ToString();
        htmlTableRow.Cells.Add(htmlTableCell5);
        HtmlTableCell htmlTableCell6 = new HtmlTableCell();

        htmlTableCell6.InnerText = objInfo.InputAmount.ToString();
        htmlTableRow.Cells.Add(htmlTableCell6);
        HtmlTableCell htmlTableCell7 = new HtmlTableCell();

        htmlTableCell7.InnerText = objInfo.InputCompAmount.ToString();
        htmlTableRow.Cells.Add(htmlTableCell7);
        HtmlTableCell htmlTableCell8 = new HtmlTableCell();

        htmlTableCell8.InnerText = objInfo.InputCompRate.ToString();
        htmlTableRow.Cells.Add(htmlTableCell8);
        htmlTableRow.Height = "22";
        htmlTableRow.Style.Add("Display", "none");
        htmlTableRow.Attributes["onclick"]     = "doClick(this,\"tbReport\");";
        htmlTableRow.Attributes["onmouseover"] = "doMouseOver(this);";
        htmlTableRow.Attributes["onmouseout"]  = "doMouseOut(this);";
        this.tbReport.Rows.Add(htmlTableRow);
    }