Example #1
0
        public IEnumerable<Work> GetWorkByElement(Element Element)
        {
            var Result = new List<Work>();
            var ConnString = WebConfigurationManager.ConnectionStrings["DebugConn"].ConnectionString;

            using(SqlConnection Conn = new SqlConnection(ConnString))
            {
                Conn.Open();
                using(var Cmd = new SqlCommand("",Conn))
                {
                    Cmd.CommandText = @"SELECT [TIP]
                                      ,[IND]
                                      ,[PICH]
                                      ,[C]
                                      ,[F]
                                      ,[NSI].[dbo].[TEXNORM].[L]
                                      ,[NV]
                                      ,[obozn]
	                                  ,NSI.dbo.NAPROF.NAZVO
                                  FROM [NSI].[dbo].[TEXNORM]
   INNER JOIN NSI.dbo.NAPROF ON NSI.dbo.NAPROF.L = [NSI].[dbo].[TEXNORM].L
   WHERE IND = @IND AND PICH = @PICH
   ORDER BY F Asc";
                    Cmd.Parameters.AddWithValue("IND", Element.Index);
                    Cmd.Parameters.AddWithValue("PICH", Element.Denotation);
                    using(var dr = Cmd.ExecuteReader())
                    {
                        while(dr.Read())
                        {
                            var Work = new Work();
                            Work.Duration = (Double)dr["NV"];
                            Work.Name = (String)dr["NAZVO"];
                            Work.ChainNumber = Convert.ToInt32(dr["F"]);
                            Work.Department = new Department()
                            {
                                ShortName = dr["C"].ToString()
                            };
                            Work.Element = Element;
                            Result.Add(Work);
                        }
                    }
                }
            }
            return Result;
        }
Example #2
0
 public WorkViewModel(Work Work_)
 {
    
 }
Example #3
0
 public IEnumerable<Work> GetPreparationWorks()
 {
     var PaymentWork = this.StandartWorks.First(x => x.Name == "Оплата");
     List<Work> Result = new List<Work>();
     var PrepDepartments = this.Departments.Where(x => x.Id < 15);
     foreach(var Department in PrepDepartments)
     {
         var Work = new Work();
         Work.Department = Department;
         Work.Duration = Department.Duration;
         Work.XOffset = PaymentWork.XOffset + PaymentWork.Duration;
         Result.Add(Work);
     }
     return Result;
 }
Example #4
0
 public IEnumerable<Work> GetMainWorks()
 {
     var Purchased = this.StandartWorks.First(x => x.Name == "Закуп. ПКИ");
     List<Work> Result = new List<Work>();
     var PrepDepartments = this.Departments.Where(x => x.Id > 15);
     foreach (var Department in PrepDepartments)
     {
         var Work = new Work();
         Work.Department = Department;
         Work.Duration = Department.Duration;
         Work.XOffset = Purchased.XOffset + Purchased.Duration;
         Result.Add(Work);
     }
     return Result;
 }
Example #5
0
        public IEnumerable<Work> GetStandartWorks()
        {
            var Result = new List<Work>();

            var ContractWork = new Work();
            ContractWork.Name = "Контракт";
            ContractWork.Duration = 6;

            var AuctionWork = new Work();
            AuctionWork.Name = "Торги";
            AuctionWork.Duration = 70;
            AuctionWork.XOffset = ContractWork.Duration;

            var PaymentWork = new Work();
            PaymentWork.Name = "Оплата";
            PaymentWork.Duration = 17;
            PaymentWork.XOffset = AuctionWork.XOffset + AuctionWork.Duration + 40;

            var BuyMaterialsWork = new Work();
            BuyMaterialsWork.Name = "Закуп. матер.";
            BuyMaterialsWork.Duration = 200;
            BuyMaterialsWork.XOffset = PaymentWork.XOffset + PaymentWork.Duration;

            var BuyPurchasedWork = new Work();
            BuyPurchasedWork.Name = "Закуп. ПКИ";
            BuyPurchasedWork.Duration = 200;
            BuyPurchasedWork.XOffset = PaymentWork.XOffset + PaymentWork.Duration;


            Result.Add(ContractWork);
            Result.Add(AuctionWork);
            Result.Add(PaymentWork);
            Result.Add(BuyMaterialsWork);
            Result.Add(BuyPurchasedWork);

            return Result;
        }