コード例 #1
0
ファイル: RentalBL.cs プロジェクト: leahr0040/C-
        public static bool AddRental(RentalDTO rd)
        {
            Rental r  = RentalDTO.ToDal(rd);
            int    id = RentalDAL.AddRental(r);

            if (id != 0)
            {
                if (rd.Dock != null)
                {
                    Document doc = new Document();
                    doc.DocCoding = rd.Dock;
                    doc.DocUser   = id;
                    doc.type      = 3;
                    doc.DocName   = rd.DocName;
                    DocumentBL.AddUserDocuments(new DocumentDTO(doc));
                }
                if (rd.ContactRenew == true && (rd.EndDate).Value < DateTime.Today.AddMonths(3))
                {
                    Bl.TaskBL.AddRenewTask(rd.PropertyID, rd.SubPropertyID);
                }
                return(true);
            }
            return(false);
        }