示例#1
0
        public void CreateContactPersone()
        {
            ContactPerson cp = new ContactPerson();

            cp.FirstName   = "Jarosav";
            cp.LastName    = "Runcik";
            cp.Email       = "*****@*****.**";
            cp.PhoneNumber = "+420 602 658 348";

            cp.Save();
            cp.Delete();
        }
 public bool DeleteContactPerson(ContactPerson model)
 {
     try
     {
         model.Delete();
         return(true);
     }
     catch (Exception ex)
     {
         string error = "";
         CommonMethods.getError(ex, ref error);
         throw new Exception(CommonMethods.ConcatenateErrorIN_DB(DB_Exception.res_09, error, CommonMethods.GetCurrentMethodName()));
     }
 }
示例#3
0
        public void CreateOrder()
        {
            ContactPerson cp = new ContactPerson();

            cp.FirstName   = "Jarosav";
            cp.LastName    = "Runcik";
            cp.Email       = "*****@*****.**";
            cp.PhoneNumber = "+420 602 658 348";

            cp.Save();

            PaperType paperType = new PaperType();

            paperType.Color = System.Drawing.Color.Blue;
            paperType.Type  = "Stitek";

            paperType.Save();

            Proofsheet proofsheet = new Proofsheet();

            proofsheet.Time   = DateTime.Now;
            proofsheet.Passed = true;

            proofsheet.Save();



            try
            {
                Order order = new Order();

                order.Contact    = cp;
                order.Format     = TiskarnaVosahlo.PaperFormats.GetFormat("A4");
                order.PaperType  = paperType;
                order.Proofsheet = proofsheet;

                order.Save();
                order.Delete();
            }
            finally
            {
                proofsheet.Delete();
                paperType.Delete();
                cp.Delete();
            }
        }