Exemple #1
0
        public static string FormatSalBudgetFieldValue(object objVal, string FieldName)
        {
            string text2;

            try
            {
                string intShowString = "";
                if (FieldName.ToUpper() == "HOUSECOUNT")
                {
                    intShowString = MathRule.GetIntShowString(objVal);
                }
                else
                {
                    intShowString = MathRule.GetDecimalShowString(objVal);
                }
                text2 = intShowString;
            }
            catch (Exception exception)
            {
                throw exception;
            }
            return(text2);
        }
Exemple #2
0
 private static void FillSalBudgetDtlByYMInfra(DataTable tb, string ProjectCode, int y, int m, string ColName, DataTable tbPBSType, EntityData entityBudget)
 {
     try
     {
         string[] textArray  = new string[] { "套数", "面积", "均价", "销售额", "回款额" };
         string[] textArray2 = new string[] { "", "平米", "元", "万元", "万元" };
         string[] textArray3 = new string[] { "int", "decimal", "decimal", "decimal", "decimal" };
         string[] textArray4 = new string[] { "HouseCount", "HouseArea", "Price", "Money", "RcvMoney" };
         int      num        = 0;
         for (int i = 0; i < textArray.Length; i++)
         {
             num++;
             string text  = textArray[i];
             string text2 = textArray4[i];
             string text3 = textArray2[i];
             string text4 = textArray3[i];
             string text5 = text;
             if (text3 != "")
             {
                 text5 = text5 + "<br>(" + text3 + ")";
             }
             foreach (DataRow row2 in tbPBSType.Rows)
             {
                 DataRow   row;
                 string    pBSTypeCode = ConvertRule.ToString(row2["PBSTypeCode"]);
                 DataRow[] rowArray    = tb.Select("FieldName='" + text2 + "' and PBSTypeCode='" + pBSTypeCode + "'");
                 if (rowArray.Length == 0)
                 {
                     row                  = tb.NewRow();
                     row["sno"]           = num;
                     row["ItemName"]      = text;
                     row["FieldName"]     = text2;
                     row["Unit"]          = text3;
                     row["FieldType"]     = text4;
                     row["ItemDesc"]      = text5;
                     row["IsAct"]         = 0;
                     row["IsActName"]     = "计划";
                     row["PBSTypeCode"]   = pBSTypeCode;
                     row["PBSTypeName"]   = row2["PBSTypeName"];
                     row["PBSTypeSortID"] = row2["SortID"];
                     row["PBSTypeFullID"] = row2["FullID"];
                     row["Deep"]          = row2["Deep"];
                     row["ParentCode"]    = row2["ParentCode"];
                 }
                 else
                 {
                     row = rowArray[0];
                 }
                 string  text7 = row["ItemName"].ToString();
                 string  text8 = row["FieldType"].ToString();
                 DataRow row3  = null;
                 if (m == -1)
                 {
                     DataTable table = GetSalBudgetBeforePeriodSum(ProjectCode, y, pBSTypeCode);
                     if (table.Rows.Count > 0)
                     {
                         row3 = table.Rows[0];
                     }
                 }
                 else
                 {
                     DataRow[] rowArray2 = entityBudget.CurrentTable.Select("IMonth=" + m.ToString() + " and PBSTypeCode='" + pBSTypeCode + "'");
                     if (rowArray2.Length > 0)
                     {
                         row3 = rowArray2[0];
                     }
                 }
                 if (row3 != null)
                 {
                     if (text8 == "int")
                     {
                         row[ColName] = MathRule.GetIntShowString(row3[text2]);
                     }
                     else
                     {
                         row[ColName] = MathRule.GetDecimalShowString(row3[text2]);
                     }
                 }
                 if (rowArray.Length == 0)
                 {
                     tb.Rows.Add(row);
                 }
             }
         }
     }
     catch (Exception exception)
     {
         throw exception;
     }
 }