Exemple #1
0
        public ActionResult ProcessAddContactShop()
        {
            string Name  = Request.Form["Name"];
            string Phone = Request.Form["Phone"];

            if (!(db.CheckByQuery("select * from ContactShop where Phone='" + Phone + "'")))
            {
                int InternStaffID = Convert.ToInt32(Request.Form["InternStaffID"]);
                db.ChangeByQuery("insert into ContactShop values(N'" + Name + "',N'" + Phone + "',null,'new',null,'" + DateTime.Now.ToString("MM.dd.yyyy") + "'," + InternStaffID + ")");
            }
            return(RedirectToAction("AddContactShop", "MyanmarITStar"));
        }
        public ActionResult DeletePost()
        {
            int    ID    = Convert.ToInt32(Request.QueryString["ID"]);
            string Cover = db.getStringByQuery("select * from Post where ID=" + ID, "ImageName");

            DeleteCover(Cover);
            db.ChangeByQuery("delete from Post where ID=" + ID);
            return(RedirectToAction("AllPost"));
        }
Exemple #3
0
        public ActionResult BookSeat()
        {
            int    TotalCost = 0; String TransferBill = ""; string SeatList = "";
            string passedInfo = "success";
            int    EID        = Convert.ToInt32(Request.Form["EventID"]);
            //Get EOrgID first via EID to retrieve its username
            int    EOrgID       = d.getIntByQuery("select * from Event where ID=" + EID, "EOrgID");
            string Username     = d.getStringByQuery("select * from Login where AllID=" + EOrgID + " and AccessLevel=2", "UserName");
            string EOrgPhone    = d.getStringByQuery("select * from Event where ID=" + EID, "Phone");
            string SelectedSeat = Request.Form["SelectedSeat"];
            string Name         = Request.Form["Name"];
            string Phone        = Request.Form["Phone"];
            string Operator     = Request.Form["Operator"];

            string[] separater    = { "," };
            string[] selectedSeat = SelectedSeat.Split(separater, StringSplitOptions.RemoveEmptyEntries);
            int      i            = 0;

            if (selectedSeat.Length > 0)
            {
                foreach (var word in selectedSeat)
                {
                    //In case of two parallel action, check Seat Status (Owner is Sold and User is Book)
                    if (d.getStringByQuery("select * from Seat where EID=" + EID + " and Name='" + selectedSeat[i] + "'", "Status").Equals("Sold"))
                    {
                        i          = i + 1;
                        passedInfo = "justSold";
                        continue;
                    }
                    d.ChangeByQuery("update Seat set Status='Book' where EID=" + EID + " and Name='" + selectedSeat[i] + "'");
                    int SeatID = d.getIntByQuery("select * from Seat where EID=" + EID + " and Name='" + selectedSeat[i] + "'", "ID");
                    d.ChangeByQuery("insert into CustomerTicket(Name, Phone, SeatID, InsertedDate) values(N'" + Name + "',N'" + Phone + "'," + SeatID + ",'" + DateTime.Now.ToString("yyyy-MM-dd hh:mm:ss tt") + "')");
                    TotalCost  = TotalCost + d.getIntByQuery("select * from Seat where ID=" + SeatID, "Price");
                    SeatList   = SeatList + selectedSeat[i] + "/";
                    i          = i + 1;
                    passedInfo = "success";
                }
            }
            else
            {
                passedInfo = "noSeat";
            }


            //Get Phone
            //Get Operator
            //amount - Total Price

            /*
             * MPT - *223*amount*number#
             * Ooredoo - *155*amount*number#
             * MEC - *110*amount*number#
             */

            //Check Operator for tranferring phone bill
            if (passedInfo.Equals("success"))
            {
                if (Operator.Equals("mpt"))
                {
                    TransferBill = "*223*" + TotalCost + "*" + EOrgPhone + "%23";
                }
                else if (Operator.Equals("ooredoo"))
                {
                    TransferBill = "*155*" + TotalCost + "*" + EOrgPhone + "%23";
                }
                else if (Operator.Equals("mec"))
                {
                    TransferBill = "*110*" + TotalCost + "*" + EOrgPhone + "%23";
                }

                Session["passedInfo"] = passedInfo;
                string url = Session["userurl"].ToString();

                ViewBag.Username     = Username;
                ViewBag.TransferBill = TransferBill;
                ViewBag.FromPhone    = Phone;
                ViewBag.ToPhone      = EOrgPhone;
                ViewBag.TotalCost    = TotalCost;
                ViewBag.SeatList     = SeatList;
                return(View());
            }
            else
            {
                Session["passedInfo"] = passedInfo;
                string url = Session["userurl"].ToString();
                Response.Redirect(url);
                return(View());
            }
        }
Exemple #4
0
        public ActionResult AcceptRequest()
        {
            if (Session["CurrentUserID"] == null)
            {
                Response.Redirect("~/Account/LoginForm");
            }
            int ID       = Convert.ToInt32(Request.QueryString["ID"]);
            int MemberID = Convert.ToInt32(Request.QueryString["MemberID"]);

            //Delete and Change Active in Member Table
            db.ChangeByQuery("delete from RequestActive where ID=" + ID);
            db.ChangeByQuery("delete from InactiveCount where MemberID=" + ID);
            db.ChangeByQuery("update Member set Active='True' where ID=" + MemberID);

            return(RedirectToAction("AcceptActive"));
        }
Exemple #5
0
        public ActionResult ProcessNewCustomerForm()
        {
            if (Session["CurrentUserID"] == null)
            {
                Response.Redirect("~/Login/LoginForm");
            }
            Boolean IsHoleSale = false; Boolean IsTest = true;
            int     HteTypeID = Convert.ToInt32(Request.Form["HteTypeID"]);
            int     Test      = Convert.ToInt32(Request.Form["isTest"]);

            if (HteTypeID == 1)
            {
                IsHoleSale = true;
            }
            if (Test == 1)
            {
                IsTest = false;
            }
            string Name       = Request.Form["Name"];
            string Address    = Request.Form["Address"];
            string Phone      = Request.Form["Phone"];
            string Username   = Request.Form["Username"];
            string Password   = Request.Form["Password"];
            string ExpiryDate = Request.Form["ExpiryDate"];
            int    StaffID    = Convert.ToInt32(Session["CurrentUserID"]);

            if (stock.CheckByQuery("select * from Shop where Name=N'" + Name + "' and Phone=N'" + Phone + "'") == false)
            {
                if (stock.CheckByQuery("select * from Login where Username=N'" + Username + "'") == false)
                {
                    stock.ChangeByQuery("insert into Shop values(N'" + Name + "',N'" + Phone + "',N'" + Address + "','" + DateTime.Now.ToString("MM.dd.yyyy") + "',null,'" + IsHoleSale + "','" + IsTest + "')");
                    int AllID = stock.getIntByQuery("select * from Shop where Name=N'" + Name + "' and Phone=N'" + Phone + "'", "ID");
                    stock.ChangeByQuery("insert into Login values(" + AllID + ",N'" + Username + "',N'" + Password + "',2,'True','" + ExpiryDate + "')");
                    stock.ChangeByQuery("insert into StaffShop values(" + StaffID + "," + AllID + ",'" + DateTime.Now.ToString("MM.dd.yyyy") + "')");
                    stock.ChangeByQuery("insert into HteAttribute values(" + AllID + ",2,950,1000,500,'" + DateTime.Now.ToString("MM.dd.yyyy") + "')");
                    if (IsHoleSale == true)
                    {
                        stock.ChangeByQuery("insert into HteAttribute values(" + AllID + ",1,900,940,500,'" + DateTime.Now.ToString("MM.dd.yyyy") + "')");
                    }
                }
            }
            return(RedirectToAction("AddNewCustomerForm", "Staff"));
        }
Exemple #6
0
        public ActionResult AddEventData(HttpPostedFileBase file, HttpPostedFileBase fileMap)
        {
            EOrgID = Convert.ToInt32(Session["CurrentUserID"]);
            string ImageName    = "";
            String ImageNameMap = "";

            if (file.ContentLength > 0)
            {
                var fileName = System.IO.Path.GetFileName(file.FileName);
                ImageName = fileName;
                var path = System.IO.Path.Combine(Server.MapPath("~/Image/Cover"), fileName);
                file.SaveAs(path);
            }
            if (fileMap.ContentLength > 0)
            {
                var fileNameMap = System.IO.Path.GetFileName(fileMap.FileName);
                ImageNameMap = fileNameMap;
                var path = System.IO.Path.Combine(Server.MapPath("~/Image/Seat_Map"), fileNameMap);
                fileMap.SaveAs(path);
            }
            string Name        = Request.Form["Name"];
            string Category    = Request.Form["Category"];
            string Date        = Request.Form["Date"];
            string Time        = Request.Form["Time"];
            string Place       = Request.Form["Place"];
            string Email       = Request.Form["Email"];
            string Phone       = Request.Form["Phone"];
            string IsFree      = Request.Form["isFree"];
            string IsPublic    = Request.Form["isPublic"];
            string TownID      = Request.Form["Town"];
            string Town        = d.getStringByQuery("select * from Town where ID=" + TownID, "Name");
            int    Row         = Convert.ToInt16(Request["Row"]);
            int    TotalTicket = 0;//Convert.ToInt32(Request.Form["TotalTicket"]);
            string Description = Request.Form["Description"];
            //Get EOrgID. Set to 1 in unit testing
            int      ECategoryID = Convert.ToInt32(Category);
            DateTime EDate       = Convert.ToDateTime(Date);

            d.ChangeByQuery("insert into Event(EOrgID,ECategoryID,Name,ImageName,Place,EDate,Email,Phone,TotalTicket,IsFree,Description,Row,SeatMap,Time,Town,IsPublic) values(" + EOrgID + "," + ECategoryID + ",N'" + Name + "','" + ImageName + "','" + Place + "','" + EDate + "','" + Email + "','" + Phone + "','" + TotalTicket + "','" + IsFree + "','" + Description + "'," + Row + ",'" + ImageNameMap + "','" + Time + "','" + Town + "','" + IsPublic + "')");
            int EID = d.getIntByQuery("select top 1 * From Event where EOrgID=" + EOrgID + " order by ID desc", "ID");
            Row r   = new Row();

            r.set(EID, Row);
            //Seat s = new Seat();
            //s.setTotalTicket(TotalTicket, 1);
            //s.setFirstTimeSeat();
            return(RedirectToAction("Manage"));
        }
Exemple #7
0
        public ActionResult ProcessCustomerForm()
        {
            if (Session["CurrentUserID"] == null)
            {
                Response.Redirect("~/Login/LoginForm");
            }
            string Name    = Request.Form["Name"];
            string Phone   = Request.Form["Phone"];
            string Address = Request.Form["Address"];
            int    ShopID  = Convert.ToInt32(Session["CurrentUserID"]);

            db.ChangeByQuery("delete from Customer where ID not in (select CustomerID from HteNumber)");
            db.ChangeByQuery("insert into Customer values(" + ShopID + ",N'" + Name + "',N'" + Phone + "',N'" + Address + "','" + DateTime.Now.ToString("MM.dd.yyyy") + "',2)");
            int CustomerID = db.getIntByQuery("select * from Customer where ShopID=" + ShopID + " and Name=N'" + Name + "' and Phone=N'" + Phone + "'", "ID");

            Session["CustomerID"] = CustomerID;
            return(RedirectToAction("HteNumberForm", "Shop"));
        }
Exemple #8
0
        public ActionResult ProcessAddShopForm()
        {
            string Name    = Request.Form["Name"];
            string Phone   = Request.Form["Phone"];
            string Address = Request.Form["Address"];

            db.ChangeByQuery("insert into Shop values('" + Name + "','" + Phone + "','" + Address + "','" + DateTime.Now + "')");
            return(RedirectToAction("AddShopForm", "Owner"));
        }