Exemple #1
0
        public static decimal GetSalTotalCostByProjectBuilding(string ProjectCode, string BuildingName)
        {
            decimal num2;

            try
            {
                decimal    @decimal = 0M;
                EntityData salCostByProjectBuilding = SalDAO.GetSalCostByProjectBuilding(ProjectCode, BuildingName);
                if (salCostByProjectBuilding.HasRecord())
                {
                    try
                    {
                        @decimal = salCostByProjectBuilding.GetDecimal("TotalCost");
                    }
                    catch
                    {
                    }
                }
                salCostByProjectBuilding.Dispose();
                num2 = @decimal;
            }
            catch (Exception exception)
            {
                throw exception;
            }
            return(num2);
        }
Exemple #2
0
 public static void MapSalSupl(string ProjectCode, int type)
 {
     try
     {
         EntityData entity = SalDAO.GetSalContractByProjectCode(ProjectCode);
         if (entity.HasRecord())
         {
             int count = entity.CurrentTable.Rows.Count;
             for (int i = 0; i < count; i++)
             {
                 entity.SetCurrentRow(i);
                 string suplCodeByName = GetSuplCodeByName(GetSuplNameByContract(entity.GetString("ContractID"), type), ProjectCode);
                 if ((suplCodeByName != "") && (suplCodeByName != entity.GetString("SuplCode")))
                 {
                     entity.CurrentTable.Rows[i]["SuplCode"] = suplCodeByName;
                     SalDAO.UpdateSalContract(entity);
                 }
             }
         }
         entity.Dispose();
     }
     catch (Exception exception)
     {
         throw exception;
     }
 }
Exemple #3
0
 public static void MapSalRoom(string ProjectCode)
 {
     try
     {
         EntityData entity = SalDAO.GetSalContractByProjectCode(ProjectCode);
         if (entity.HasRecord())
         {
             int count = entity.CurrentTable.Rows.Count;
             for (int i = 0; i < count; i++)
             {
                 entity.SetCurrentRow(i);
                 string contractCode = entity.GetString("ContractCode");
                 string chamberName  = entity.GetString("ChamberName");
                 string roomName     = entity.GetString("Room");
                 string roomCode     = ProductRule.GetRoomCodeByChamberRoomName(chamberName, roomName, ProjectCode);
                 if (roomCode != entity.GetString("RoomCode"))
                 {
                     entity.CurrentTable.Rows[i]["RoomCode"] = roomCode;
                     SalDAO.UpdateSalContract(entity);
                 }
                 UpdateRoomSalState(roomCode, contractCode);
             }
         }
         entity.Dispose();
     }
     catch (Exception exception)
     {
         throw exception;
     }
 }
Exemple #4
0
        public static DataTable GenerateSalBudgetDtlTableInfra(string ProjectCode, int IYear)
        {
            DataTable table4;

            try
            {
                int       num;
                DataTable tb = new DataTable("SalBudget");
                tb.Columns.Add(new DataColumn("sno", typeof(int)));
                tb.Columns.Add(new DataColumn("ItemName", typeof(string)));
                tb.Columns.Add(new DataColumn("FieldName", typeof(string)));
                tb.Columns.Add(new DataColumn("Unit", typeof(string)));
                tb.Columns.Add(new DataColumn("ItemDesc", typeof(string)));
                tb.Columns.Add(new DataColumn("FieldType", typeof(string)));
                tb.Columns.Add(new DataColumn("PBSTypeCode", typeof(string)));
                tb.Columns.Add(new DataColumn("PBSTypeName", typeof(string)));
                tb.Columns.Add(new DataColumn("PBSTypeSortID", typeof(int)));
                tb.Columns.Add(new DataColumn("PBSTypeFullID", typeof(string)));
                tb.Columns.Add(new DataColumn("Deep", typeof(int)));
                tb.Columns.Add(new DataColumn("ParentCode", typeof(string)));
                tb.Columns.Add(new DataColumn("IsAct", typeof(int)));
                tb.Columns.Add(new DataColumn("IsActName", typeof(string)));
                tb.Columns.Add(new DataColumn("y0", typeof(string)));
                for (num = 0; num <= 12; num++)
                {
                    tb.Columns.Add(new DataColumn("m" + num.ToString(), typeof(string)));
                }
                for (num = 1; num <= 2; num++)
                {
                    tb.Columns.Add(new DataColumn("y" + num.ToString(), typeof(string)));
                }
                DataTable  tbPBSType    = GetSalPBSType(true);
                EntityData entityBudget = SalDAO.GetSalBudgetDtlByProjectYear(ProjectCode, IYear);
                FillSalBudgetDtlByYMInfra(tb, ProjectCode, IYear, -1, "y0", tbPBSType, entityBudget);
                for (int i = 0; i <= 12; i++)
                {
                    FillSalBudgetDtlByYMInfra(tb, ProjectCode, IYear, i, "m" + i.ToString(), tbPBSType, entityBudget);
                }
                for (num = 1; num <= 2; num++)
                {
                    EntityData salBudgetDtlByProjectYear = SalDAO.GetSalBudgetDtlByProjectYear(ProjectCode, IYear + num);
                    FillSalBudgetDtlByYMInfra(tb, ProjectCode, IYear + num, 0, "y" + num.ToString(), tbPBSType, salBudgetDtlByProjectYear);
                    salBudgetDtlByProjectYear.Dispose();
                }
                DataTable tbSrc = tb.Clone();
                foreach (DataRow row in tb.Rows)
                {
                    DataRow row2 = tbSrc.NewRow();
                    row2["sno"]           = row["sno"];
                    row2["IsAct"]         = 1;
                    row2["IsActName"]     = "实际";
                    row2["ItemName"]      = row["ItemName"];
                    row2["FieldName"]     = row["FieldName"];
                    row2["Unit"]          = row["Unit"];
                    row2["ItemDesc"]      = row["ItemDesc"];
                    row2["FieldType"]     = row["FieldType"];
                    row2["PBSTypeCode"]   = row["PBSTypeCode"];
                    row2["PBSTypeName"]   = row["PBSTypeName"];
                    row2["PBSTypeSortID"] = row["PBSTypeSortID"];
                    row2["PBSTypeFullID"] = row["PBSTypeFullID"];
                    row2["Deep"]          = row["Deep"];
                    row2["ParentCode"]    = row["ParentCode"];
                    tbSrc.Rows.Add(row2);
                }
                foreach (DataRow row2 in tbSrc.Rows)
                {
                    DataRow drDst = tb.NewRow();
                    ConvertRule.DataRowCopy(row2, drDst, tbSrc, tb);
                    tb.Rows.Add(drDst);
                }
                entityBudget.Dispose();
                table4 = tb;
            }
            catch (Exception exception)
            {
                throw exception;
            }
            return(table4);
        }