/// <summary>
        /// Save location
        /// </summary>
        private int SaveBooking()
        {
            Generic <PNK_Booking> genericBLL = new Generic <PNK_Booking>();
            Generic2C <PNK_Booking, PNK_BookingDesc> generic2CBLL = new Generic2C <PNK_Booking, PNK_BookingDesc>();
            PNK_Booking     bookingObj   = new PNK_Booking();
            PNK_BookingDesc bookingObjVn = new PNK_BookingDesc();
            PNK_BookingDesc bookingObjEn = new PNK_BookingDesc();

            //if (this.productcategoryId == int.MinValue)
            //{
            //get data insert
            bookingObj          = this.GetDataObjectParent(bookingObj);
            bookingObj.Ordering = genericBLL.getOrdering();
            bookingObjVn        = this.GetDataObjectChild(bookingObjVn, Constant.DB.LangId);
            bookingObjEn        = this.GetDataObjectChild(bookingObjEn, Constant.DB.LangId_En);

            List <PNK_BookingDesc> lst = new List <PNK_BookingDesc>();

            lst.Add(bookingObjVn);
            lst.Add(bookingObjEn);

            //excute
            bookingId = generic2CBLL.Insert(bookingObj, lst);

            return(bookingId);
        }
Exemple #2
0
        /// <summary>
        /// Save location
        /// </summary>
        private int SaveBooking()
        {
            Generic <PNK_Booking> genericBLL = new Generic <PNK_Booking>();
            Generic2C <PNK_Booking, PNK_BookingDesc> generic2CBLL = new Generic2C <PNK_Booking, PNK_BookingDesc>();
            PNK_Booking     objBooking   = new PNK_Booking();
            PNK_BookingDesc bookingObjVn = new PNK_BookingDesc();
            PNK_BookingDesc bookingObjEn = new PNK_BookingDesc();

            //if (this.productcategoryId == int.MinValue)
            //{
            //get data insert
            objBooking          = this.GetDataObjectParent(objBooking);
            objBooking.Ordering = genericBLL.getOrdering();
            bookingObjVn        = this.GetDataObjectChild(bookingObjVn, Constant.DB.LangId);
            bookingObjEn        = this.GetDataObjectChild(bookingObjEn, Constant.DB.LangId_En);

            List <PNK_BookingDesc> lst = new List <PNK_BookingDesc>();

            lst.Add(bookingObjVn);
            lst.Add(bookingObjEn);

            //Giữ lại để chuyển qua form bookingresult
            Session["objBooking"]     = objBooking;
            Session["lstBookingDesc"] = lst;

            //excute
            //bookingId = generic2CBLL.Insert(objBooking, lst);

            //Send email đến KH
            //if (bookingId != int.MinValue)
            //{
            //    SendEmailTempate(objBooking);
            //}
            return(bookingId);
        }
        /// <summary>
        /// get data child for insert update
        /// </summary>
        /// <param name="contdescObj"></param>
        /// <returns></returns>
        private PNK_BookingDesc GetDataObjectChild(PNK_BookingDesc productcatdescObj, int lang)
        {
            switch (lang)
            {
            case 1:
                productcatdescObj.MainId = 1;
                productcatdescObj.LangId = Constant.DB.LangId;
                productcatdescObj.Name   = SanitizeHtml.Sanitize(txtFullName.Value);
                break;

            case 2:
                productcatdescObj.MainId = 1;
                productcatdescObj.LangId = Constant.DB.LangId_En;
                productcatdescObj.Name   = SanitizeHtml.Sanitize(txtFullName.Value);
                break;
            }
            return(productcatdescObj);
        }
Exemple #4
0
        /// <summary>
        /// get data child for insert update
        /// </summary>
        /// <param name="contdescObj"></param>
        /// <returns></returns>
        private PNK_BookingDesc GetDataObjectChild(PNK_BookingDesc productcatdescObj, int lang)
        {
            switch (lang)
            {
            case 1:
                productcatdescObj.MainId = 1;
                productcatdescObj.LangId = Constant.DB.LangId;
                productcatdescObj.Name   = SanitizeHtml.Sanitize(string.Format("{0} {1}", txtFirstName.Value, txtLastName.Value));
                break;

            case 2:
                productcatdescObj.MainId = 1;
                productcatdescObj.LangId = Constant.DB.LangId_En;
                productcatdescObj.Name   = SanitizeHtml.Sanitize(string.Format("{0} {1}", txtFirstName.Value, txtLastName.Value));
                break;
            }
            return(productcatdescObj);
        }
Exemple #5
0
        /// <summary>
        /// get data child for insert update
        /// </summary>
        /// <param name="contdescObj"></param>
        /// <returns></returns>
        private PNK_BookingDesc GetDataObjectChild(PNK_BookingDesc productcatdescObj, int lang)
        {
            switch (lang)
            {
            case 1:
                productcatdescObj.MainId = this.productcategoryId;
                productcatdescObj.LangId = Constant.DB.LangId;

                break;

            case 2:
                productcatdescObj.MainId = this.productcategoryId;
                productcatdescObj.LangId = Constant.DB.LangId_En;


                break;
            }
            return(productcatdescObj);
        }
Exemple #6
0
        /// <summary>
        /// Save location
        /// </summary>
        private void SaveBookingCategory()
        {
            PNK_Booking     productcatObj   = new PNK_Booking();
            PNK_BookingDesc productcatObjVn = new PNK_BookingDesc();
            PNK_BookingDesc productcatObjEn = new PNK_BookingDesc();

            if (this.productcategoryId == int.MinValue)
            {
                //get data insert
                productcatObj          = this.GetDataObjectParent(productcatObj);
                productcatObj.PostDate = DateTime.Now;
                productcatObj.Ordering = genericBLL.getOrdering();
                productcatObjVn        = this.GetDataObjectChild(productcatObjVn, Constant.DB.LangId);
                productcatObjEn        = this.GetDataObjectChild(productcatObjEn, Constant.DB.LangId_En);

                List <PNK_BookingDesc> lst = new List <PNK_BookingDesc>();
                lst.Add(productcatObjVn);
                lst.Add(productcatObjEn);
                //excute
                this.productcategoryId = generic2CBLL.Insert(productcatObj, lst);
            }
            else
            {
                string[] fields = { "Id" };
                productcatObj.Id = this.productcategoryId;

                productcatObj = genericBLL.Load(productcatObj, fields);
                //string publisheddOld = productcatObj.Published;
                //get data update
                productcatObj   = this.GetDataObjectParent(productcatObj);
                productcatObjVn = this.GetDataObjectChild(productcatObjVn, Constant.DB.LangId);
                productcatObjEn = this.GetDataObjectChild(productcatObjEn, Constant.DB.LangId_En);
                List <PNK_BookingDesc> lst = new List <PNK_BookingDesc>();
                lst.Add(productcatObjVn);
                lst.Add(productcatObjEn);
                //excute
                generic2CBLL.Update(productcatObj, lst, fields);
                //neu ve Published oo thay doi thi chay ham ChangeWithTransaction de doi Published cac con va cac product
                //if (publisheddOld != productcatObj.Published)
                //    PNK_Booking.ChangeWithTransaction(DBConvert.ParseString(this.productcategoryId), productcatObj.Published);
            }
        }