예제 #1
0
        protected void AddCheckOutVisitor(object sender, EventArgs e)
        {
            AddNewCheckOutRequest objAddCheckOutRequest = new AddNewCheckOutRequest();
            checkout objchickout = new checkout();

            objchickout.checkin_id   = "12345";
            objchickout.checkout_id  = "345";
            objchickout.user_id      = txtNricID2.Text;
            objchickout.user_name    = txtName2.Text;
            objchickout.telephone    = txtTeleNo2.Text;
            objchickout.user_address = txtAddress2.Text;
            objchickout.company_from = txtCompanyFrom2.Text;
            objchickout.vehicle_no   = txtVehicleNo2.Text;
            objchickout.key_no       = txtKeyNo2.Text;
            objchickout.user_image   = "hdgsd";
            objchickout.remarks      = txtRemarks2.Text;
            objchickout.pass_no      = txtPassNo2.Text;
            objchickout.to_visit     = txtToVisit2.Text;
            objchickout.purpose      = txtVisitorPurpose2.Text;



            AdminBLL ws = new AdminBLL();

            ws.AddCheckOutVisiter(objchickout);
            HttpContext.Current.Items.Add("COMPLETE", "INSERT");
            Server.Transfer("..//SMSADMIN//AddNewUserComplete.aspx");
        }
예제 #2
0
        public void Test_Checkout_Invalid_Input()
        {
            checkout a = new checkout();

            result result1 = a.bill("Apole,Apple,Apple,Avocado,Apple");

            Assert.AreEqual("Please check the input", result1.errormessage);
        }
예제 #3
0
        public void Test_Checkout()
        {
            checkout a       = new checkout();
            decimal  result  = (decimal)0.85;
            result   result1 = a.bill("Apple,Apple,Apple,Avocado,Apple");

            Assert.AreEqual(result, result1.opresult);
        }
예제 #4
0
 public void AddCheckOutContractor(checkout objcheckout)
 {
     try
     {
         AdminDAL objAdminDAL = new AdminDAL();
         objAdminDAL.AddCheckOutContractor(objcheckout);
     }
     catch (Exception es)
     {
         throw es;
     }
 }
예제 #5
0
 private bool registerEmployee(employees e)
 {
     try
     {
         using (smartclocksrldbEntities db = new smartclocksrldbEntities())
         {
             if (!this.Cache.Contains(e.id))
             {
                 checkin oCheckin = new checkin
                 {
                     employeeID   = e.id,
                     checkDate    = DateTime.Now.Date,
                     checkHour    = DateTime.Now.ToString("HH:mm:ss"),
                     observations = null
                 };
                 db.checkin.Add(oCheckin);
                 db.SaveChanges();
                 lblStatus.Text      = "Check In";
                 lblStatus.ForeColor = Color.LightGreen;
                 this.Cache.Add(e.id);
                 return(true);
             }
             else
             {
                 checkout oCheckout = new checkout
                 {
                     employeeID   = e.id,
                     checkDate    = DateTime.Now.Date,
                     checkHour    = DateTime.Now.ToString("HH:mm:ss"),
                     observations = null
                 };
                 db.checkout.Add(oCheckout);
                 db.SaveChanges();
                 lblStatus.Text      = "Check Out";
                 lblStatus.ForeColor = Color.LightGreen;
                 this.Cache.Remove(e.id);
                 return(true);
             }
         }
     }
     catch (Exception ex)
     {
         MessageBox.Show("Error " + ex.Message);
         return(false);
     }
 }
예제 #6
0
        public ActionResult AddTocart(NameValueCollection nvclc)
        {
            nvclc = Request.Form;
            string a        = nvclc["quantity"];
            int    quantity = Convert.ToInt32(a);
            //int quantity = 1;

            string userId       = nvclc["userId"];
            string bookId       = nvclc["bookId"];
            string categoryName = nvclc["categoryName"];
            double price        = Convert.ToDouble(nvclc["price"]);
            string authorName   = nvclc["authorName"];
            string bookName     = nvclc["bookName"];

            using (FantasticContext context = new FantasticContext())
            {
                checkout check = new checkout();

                check.bookId       = bookId;
                check.userId       = userId;
                check.price        = price * quantity;
                check.quantity     = quantity;
                check.authorName   = authorName;
                check.categoryName = categoryName;
                check.bookName     = bookName;



                context.checkouts.Add(check);
                context.SaveChanges();

                //cart cart = context.carts.SingleOrDefault(d => d.cartId == bookId);
                //context.carts.Remove(cart);
                //context.SaveChanges();
                return(Redirect("/home/checkout"));
            }

            return(RedirectToAction("checkout", "home"));
        }
예제 #7
0
        public void CheckOutItem(int assetId, int libraryCardId)
        {
            if (IsCheckedOut(assetId))
            {
                return;
            }
            var item = _context.libraryAssets
                       .FirstOrDefault(a => a.Id == assetId);


            UpdateAssetStatus(assetId, "Checked out");
            var LibraryCard = _context.libraryCards
                              .Include(card => card.Checkouts)
                              .FirstOrDefault(card => card.Id == libraryCardId);
            var now = DateTime.Now;

            var checkout = new checkout
            {
                LibraryAsset = item,
                LibraryCard  = LibraryCard,
                Since        = now,
                Until        = GetDefaultCheckoutTime(now)
            };

            _context.Add(checkout);

            var checkoutHistory = new CheckoutHistory
            {
                CheckOut     = now,
                LibraryAsset = item,
                LibraryCard  = LibraryCard
            };

            _context.Add(checkoutHistory);

            _context.SaveChanges();
        }
예제 #8
0
        protected void Btn_insert_Click(object sender, EventArgs e)
        {
            REGISTER insertreg = new REGISTER {
                FNAME = tbx_Fname.Text, LNAME = tbx_Lname.Text, EMAILID = tbx_Email.Text, PASSWORD = tbx_Password.Text
            };
            int id = BAL.InsertRegister(insertreg);

            foreach (ListItem li in chklistbooks.Items)
            {
                if (li.Selected)
                {
                    checkout checkoutdetails = new checkout {
                        user_id = id, book_id = Convert.ToInt32(li.Value)
                    };
                    BAL.InsertBooksCollected(checkoutdetails);
                }
            }
            address insertadd = new address {
                city = tbx_City.Text, state = tbx_State.Text, street = tbx_Street.Text, user_id = id
            };

            BAL.InsertAddress(insertadd);
            Response.Redirect("default.aspx?msg=Student Details inserted successfully.");
        }
예제 #9
0
        protected void Btn_insert_Click(object sender, EventArgs e)
        {
            CustomerRegestration insertreg = new CustomerRegestration {
                FirstNAME = tbx_Fname.Text, LastNAME = tbx_Lname.Text, EMAILID = tbx_Email.Text, PHONE = tbx_Phone.Text
            };
            int id = BAL.InsertRegister(insertreg);

            foreach (ListItem li in chklists.Items)
            {
                if (li.Selected)
                {
                    checkout checkoutdetails = new checkout {
                        Address_id = id, Room_id = Convert.ToInt32(li.Value)
                    };
                    BAL.InsertRoomsBooked(checkoutdetails);
                }
            }
            Customeraddress insertadd = new Customeraddress {
                city = tbx_City.Text, state = tbx_State.Text, street = tbx_Street.Text, Address_id = id
            };

            BAL.InsertAddress(insertadd);
            Response.Redirect("default.aspx?msg=Customer Details inserted successfully.");
        }
예제 #10
0
 public static void InsertRoomsBooked(checkout checkoutdetails)
 {
     DAL.InsertRoomsBooked(checkoutdetails);
 }
예제 #11
0
        protected void AddCheckOutGuard(object sender, EventArgs e)
        {
            SpaMaster SM = (SpaMaster)Page.Master;

            log4net.ILog logger = log4net.LogManager.GetLogger("File");
            try
            {
                Boolean  ok          = false;
                checkout objchickout = new checkout();
                String   ZipRegex    = "^[a-z A-Z 0-9]+$";
                if (Regex.IsMatch(txtID1.Text, ZipRegex))
                {
                    DataTable dt = dal.getdata("Select Staff_ID from UserInformation where NRICno='" + txtID1.Text.Trim() + "' and Role = '" + txtrole.Text.Trim() + "' and Staff_ID='" + Session["StaffID1"].ToString() + "'");
                    DataSet   rd = new DataSet();
                    if (dt.Rows.Count > 0)
                    {
                        rd = dal.getdataset("select * from checkin_manager where UserID='" + dt.Rows[0][0].ToString() + "' and Role='" + txtrole.Text + "' order by Checkin_DateTime desc ");

                        if (rd.Tables[0].Rows.Count > 0)
                        {
                            objchickout.user_id   = rd.Tables[0].Rows[0]["UserID"].ToString();
                            objchickout.user_name = rd.Tables[0].Rows[0]["user_name"].ToString();
                            objchickout.telephone = rd.Tables[0].Rows[0]["telephone"].ToString();

                            objchickout.key_no  = rd.Tables[0].Rows[0]["Key_no"].ToString();
                            objchickout.pass_no = rd.Tables[0].Rows[0]["Pass_No"].ToString();
                            objchickout.Role    = rd.Tables[0].Rows[0]["Role"].ToString();

                            objchickout.Checkin_DateTime = Convert.ToDateTime(rd.Tables[0].Rows[0]["Checkin_DateTime"].ToString());
                            objchickout.checkin_id       = rd.Tables[0].Rows[0]["checkin_id"].ToString();
                            objchickout.NRICno           = rd.Tables[0].Rows[0]["NRICno"].ToString();
                            objchickout.Location_id      = rd.Tables[0].Rows[0]["LocationID"].ToString();
                        }
                        else
                        {
                            //lblerror.Visible = true;
                            //lblerror.Text = "No Operation Manager with this NRIC/FIN No. checked In ..!";
                            //lblerr1.Visible = true;
                            SM.ShowErrorMessage("You Have Already Checkout..");
                            return;
                            //throw new Exception();
                        }
                    }
                    else
                    {
                        //lblerror.Visible = true;
                        //lblerror.Text = "No Operation Manager with this NRIC/FIN No. exists in database !";
                        //lblerr1.Visible = true;
                        //throw new Exception();
                        SM.ShowErrorMessage("No Operation Manager with this NRIC/FIN No. exists in database !");
                        return;
                    }

                    /*string time = string.Empty;
                     * time = ConfigurationManager.AppSettings.Get("SPATime");
                     * double newtime = Convert.ToDouble(time);
                     * objchickout.Checkout_DateTime = DateTime.Now.AddHours(newtime);*/
                    objchickout.Checkout_DateTime = DateTime.Now;
                    AdminBLL ws = new AdminBLL();
                    ws.AddCheckOutGaurd(objchickout);
                    ok = true;
                    if (ok == true)
                    {
                        removedata();
                    }
                    HttpContext.Current.Items.Add("COMPLETE", "INSERT");
                    SM.ShowErrorMessage("Check Out Successfully..!");

                    // Server.Transfer("..//SMSADMIN//AlertUpdateComplete.aspx");
                }
                else
                {
                    //lblerror.Visible = true;
                    //lblerror.Text = "Invalid NRIC/FIN No. ..!";
                    //lblerr1.Visible = true;
                    SM.ShowErrorMessage("Invalid NRIC/FIN No. ..!");
                }
            }
            catch (Exception ex)
            {
                logger.Info(ex.Message);
            }
        }
 public checkoutInterface()
 {
     InitializeComponent();
     checkout = new checkout();
 }
예제 #13
0
 public void Add(checkout newCheckout)
 {
     _context.Add(newCheckout);
     _context.SaveChanges();
 }
예제 #14
0
 public static void InsertBooksCollected(checkout checkoutdetails)
 {
     DAL.InsertCheckoutBooks(checkoutdetails);
 }