Ejemplo n.º 1
0
        /// <summary>
        /// Save location
        /// </summary>
        private int Save(string id, string name)
        {
            int                      priceId       = DBConvert.ParseInt(id);
            PNK_PriceClass           productcatObj = new PNK_PriceClass();
            Generic <PNK_PriceClass> genericBLL    = new Generic <PNK_PriceClass>();

            if (priceId == int.MinValue)
            {
                productcatObj.Name = name;

                //excute
                genericBLL.Insert(productcatObj);
            }
            else
            {
                productcatObj.Name = name;
                productcatObj.ID   = priceId;

                //excute
                genericBLL.Update(productcatObj, productcatObj, new string[] { "Id" });
                grdTourPriceClass.EditIndex = -1;
            }

            BindData();

            return(priceId);
        }
Ejemplo n.º 2
0
        /// <summary>
        ///
        /// </summary>
        /// <param name="productId"></param>
        /// <param name="type">==NULL mặc định hình</param>
        /// <param name="type">==1:map</param>
        private void BindData()
        {
            PriceClassBLL bll = new PriceClassBLL();

            lst = bll.GetList();
            if (lst.Count() > 0)
            {
                grdTourPriceClass.DataSource = lst;
                grdTourPriceClass.DataBind();

                //grdTourPriceClass.Columns[4].Visible = true;
            }
            else
            {
                PNK_PriceClass pnk = new PNK_PriceClass();
                DataTable      dt  = Common.UtilityLocal.ObjectToData(pnk);
                grdTourPriceClass.DataSource = dt;
                grdTourPriceClass.DataBind();

                //grdTourPriceClass.Columns[4].Visible = false;
                foreach (GridViewRow row in grdTourPriceClass.Rows)
                {
                    if (row.RowType == DataControlRowType.DataRow)
                    {
                        LinkButton lb = ((LinkButton)row.FindControl("lnkRemove"));
                        if (lb != null)
                        {
                            lb.Visible = false;
                        }
                    }
                }
            }
        }
Ejemplo n.º 3
0
        public IList <PNK_PriceClass> GetList()
        {
            IList <PNK_PriceClass> lst          = new List <PNK_PriceClass>();
            PNK_PriceClass         bookingPrice = new PNK_PriceClass();

            lst = dal.GetAllBy(bookingPrice, "where 1=1", null);

            return(lst);
        }