Пример #1
0
 public void RefreshDateRange()
 {
     try
     {
         this.ResetDateTitleHtml();
         this.ResetContractDateRange();
         CostBudgetPageRule.ClearFieldValue(this.tb, new string[] { "PlanDataHtml" });
         if ((this.StartYm != "") && (this.EndYm != ""))
         {
             foreach (DataRow row in this.tb.Rows)
             {
                 string text          = "";
                 string text2         = row["RecordType"].ToString();
                 string contractCode  = ConvertRule.ToString(row["ContractCode"]);
                 string costCode      = ConvertRule.ToString(row["CostCode"]);
                 string text5         = ConvertRule.ToString(row["FullCode"]);
                 string pBSCode       = ConvertRule.ToString(row["PBSCode"]);
                 int    monthsBetween = StringRule.GetMonthsBetween(this.StartYm, this.EndYm);
                 for (int i = 0; i < monthsBetween; i++)
                 {
                     string text12;
                     string text7         = StringRule.YmAddMonths(this.StartYm, i);
                     string s             = string.Format("{0}-{1}-01", text7.Substring(0, 4), text7.Substring(4, 2));
                     string payoutDateEnd = DateTime.Parse(s).AddMonths(1).AddDays(-1).ToString("yyyy-MM-dd");
                     string text10        = "PayoutMoneyYm_" + text7;
                     string money         = StringRule.BuildShowNumberString(row[text10]);
                     if (pBSCode == "")
                     {
                         text12 = CostBudgetPageRule.GetContractPayRealHref(money, costCode, contractCode, "", s, payoutDateEnd, this.PBSType, pBSCode);
                     }
                     else
                     {
                         text12 = money;
                     }
                     if (text12 == "")
                     {
                         text = text + string.Format("<td>{0}</td>", text12);
                     }
                     else
                     {
                         text = text + string.Format("<td align=right nowrap>{0}</td>", text12);
                     }
                 }
                 row["PlanDataHtml"] = text;
             }
         }
     }
     catch (Exception exception)
     {
         throw exception;
     }
 }
Пример #2
0
        public static string GetDecimalShowString(DataRowView dr, string columnName)
        {
            if (dr[columnName] == DBNull.Value)
            {
                return("");
            }
            decimal num = (decimal)dr[columnName];

            if (CheckDecimalEqual(num, 0M))
            {
                return("");
            }
            return(StringRule.BuildShowNumberString(num));
        }
Пример #3
0
 public void RefreshDateRange()
 {
     try
     {
         this.ResetDateTitleHtml();
         this.ResetContractDateRange();
         CostBudgetPageRule.ClearFieldValue(this.tb, new string[] { "PlanDataHtml" });
         int num = -1;
         if ((this.StartYm != "") && (this.EndYm != ""))
         {
             foreach (DataRow row in this.tb.Rows)
             {
                 num++;
                 string text          = "";
                 string text2         = row["RecordType"].ToString();
                 string text3         = ConvertRule.ToString(row["ContractCode"]);
                 string text4         = ConvertRule.ToString(row["CostCode"]);
                 string text5         = ConvertRule.ToString(row["FullCode"]);
                 string text6         = ConvertRule.ToString(row["ParentCode"]);
                 string text7         = ConvertRule.ToString(row["ClassTd"]);
                 int    monthsBetween = StringRule.GetMonthsBetween(this.StartYm, this.EndYm);
                 for (int i = 0; i < monthsBetween; i++)
                 {
                     string text8  = StringRule.YmAddMonths(this.StartYm, i);
                     string text10 = DateTime.Parse(string.Format("{0}-{1}-01", text8.Substring(0, 4), text8.Substring(4, 2))).AddMonths(1).AddDays(-1).ToString("yyyy-MM-dd");
                     string text11 = "PlanMoneyYm_" + text8;
                     string text12 = StringRule.BuildShowNumberString(row[text11]);
                     if (this.ReadOnly)
                     {
                         text = text + string.Format("<td align=right nowrap class=\"{1}\">{0}</td>", text12, text7);
                     }
                 }
                 row["PlanDataHtml"] = text;
             }
         }
     }
     catch (Exception exception)
     {
         throw exception;
     }
 }
Пример #4
0
        public static string GetDecimalShowString(object val, string format, bool ShowZero)
        {
            if ((val == DBNull.Value) || (val == null))
            {
                return("");
            }
            decimal num = 0M;

            try
            {
                num = decimal.Parse(val.ToString());
            }
            catch
            {
            }
            if (!(!CheckDecimalEqual(num, 0M) || ShowZero))
            {
                return("");
            }
            return(StringRule.BuildShowNumberString(num, format, ShowZero));
        }
Пример #5
0
        public static string GetMoneyShowString(object money, m_MoneyUnit unit, string MoneyType)
        {
            string text2;

            try
            {
                string wanDecimalShowString = "";
                switch (unit)
                {
                case m_MoneyUnit.yuan:
                    wanDecimalShowString = StringRule.BuildShowNumberString(money, "#,##0");
                    break;

                case m_MoneyUnit.fen:
                    wanDecimalShowString = StringRule.BuildShowNumberString(money, "#,##0.00");
                    break;

                default:
                    if (MoneyType.ToLower() == "price")
                    {
                        wanDecimalShowString = MathRule.GetWanDecimalShowString(money);
                    }
                    else if (m_IsRoundWanMoney)
                    {
                        wanDecimalShowString = StringRule.BuildMoneyWanFormatString(ConvertRule.ToDecimal(money), -1, 0);
                    }
                    else
                    {
                        wanDecimalShowString = MathRule.GetWanDecimalShowString(money);
                    }
                    break;
                }
                text2 = wanDecimalShowString;
            }
            catch (Exception exception)
            {
                throw exception;
            }
            return(text2);
        }
Пример #6
0
 public void RefreshDateRange()
 {
     try
     {
         this.ResetDateTitleHtml();
         CostBudgetPageRule.ClearFieldValue(this.tb, new string[] { "PlanDataHtml" });
         if ((this.StartYm != "") && (this.EndYm != ""))
         {
             foreach (DataRow row in this.tb.Rows)
             {
                 string costCode      = ConvertRule.ToString(row["CostCode"]);
                 string text2         = "";
                 int    monthsBetween = StringRule.GetMonthsBetween(this.StartYm, this.EndYm);
                 for (int i = 0; i < monthsBetween; i++)
                 {
                     string text3         = StringRule.YmAddMonths(this.StartYm, i);
                     string s             = string.Format("{0}-{1}-01", text3.Substring(0, 4), text3.Substring(4, 2));
                     string payoutDateEnd = DateTime.Parse(s).AddMonths(1).AddDays(-1).ToString("yyyy-MM-dd");
                     string text6         = "PayoutMoneyYm_" + text3;
                     string text8         = GetPayoutHref(StringRule.BuildShowNumberString(row[text6]), costCode, s, payoutDateEnd);
                     if (text8 == "")
                     {
                         text2 = text2 + string.Format("<td>{0}</td>", text8);
                     }
                     else
                     {
                         text2 = text2 + string.Format("<td align=right nowrap>{0}</td>", text8);
                     }
                 }
                 row["PlanDataHtml"] = text2;
             }
         }
     }
     catch (Exception exception)
     {
         throw exception;
     }
 }
Пример #7
0
 public void ResetTitleHtml()
 {
     try
     {
         this.m_TitleHtml1           = "";
         this.m_TitleHtmlArea        = "";
         this.m_TitleHtmlAreaPercent = "";
         foreach (DataRow row in this.tbPBS.Rows)
         {
             if (ConvertRule.ToString(row["PBSType"]) == "B")
             {
                 this.m_TitleHtml1 = this.m_TitleHtml1 + string.Format("<th align=center nowrap>{0}</th>", CostBudgetPageRule.GetBuildingHref(ConvertRule.ToString(row["PBSCode"]), ConvertRule.ToString(row["PBSName"])) + "&nbsp;");
             }
             else
             {
                 this.m_TitleHtml1 = this.m_TitleHtml1 + string.Format("<th align=center nowrap>{0}</th>", ConvertRule.ToString(row["PBSName"]) + "&nbsp;");
             }
             this.m_TitleHtmlArea        = this.m_TitleHtmlArea + string.Format("<th align=center nowrap style='border-top:0'>{0}</th>", StringRule.BuildShowNumberString(row["Area"], "#,##0.##") + "&nbsp;");
             this.m_TitleHtmlAreaPercent = this.m_TitleHtmlAreaPercent + string.Format("<th align=center nowrap style='border-top:0'>{0}</th>", StringRule.BuildShowPercentString(row["AreaPercent"]) + "&nbsp;");
         }
     }
     catch (Exception exception)
     {
         throw exception;
     }
 }