internal bool UpdateSelectedSeries(Booklet instance)
        {
            base.com.CommandText = "spUpdateBooklet";
            base.com.Parameters.AddWithValue("_BookletID", instance.BookletID);
            base.com.Parameters.AddWithValue("_DigitFrom", instance.DigitFrom);
            base.com.Parameters.AddWithValue("_DigitTo", instance.DigitTo);
            base.com.Parameters.AddWithValue("_KioskID", instance.KioskID);
            base.com.Parameters.AddWithValue("_CreatedBy", instance.CreatedBy);
            base.com.Parameters.AddWithValue("_Pages", instance.Pages);

            int res = 0;

            try
            {
                res = Convert.ToInt32(base.com.ExecuteScalar());
            }
            catch (Exception ee)
            {
                res = 0;
            }
            finally
            {
                base.closeConnection();
            }

            return res > 0;
        }
Exemple #2
0
        public static Booklet SelectByID(int id)
        {
            var dal = new BookletDAL();

            DataRow row = dal.SelectByID(id);

            var instance = new Booklet();

            instance.Bind(row);

            return(instance);
        }
Exemple #3
0
        public static List <Booklet> GetAllData()
        {
            var dal        = new BookletDAL();
            var collection = new List <Booklet>();

            foreach (DataRow row in dal.GetAllData().Rows)
            {
                var instance = new Booklet();

                instance.Bind(row);
                collection.Add(instance);
            }


            return(collection);
        }
        protected void btnBookletSave_Click(object sender, EventArgs e)
        {
            string prefix = tbPrefix.Text.ToUpper();
            string rangefrom = tbRangeFrom.Text.ToUpper();
            string rangeto = tbRangeTo.Text.ToUpper();
            int kioskid = Convert.ToInt32(ddlKiosk.SelectedValue);
            int hdnID = Convert.ToInt32(hdnBookletID.Value);
            int pages = Convert.ToInt32(tbPages.Text);

            var instance = new Booklet();

            instance.Prefix = prefix;
            instance.DigitFrom = rangefrom;
            instance.DigitTo = rangeto;
            instance.KioskID = kioskid;
            instance.CreatedBy = GlobalAccess.EmpID;
            instance.Pages = pages;

            bool isInsert = true;
            try
            {
                if (hdnID == 0)
                {
                    Booklet.InsertNewSeries(instance);
                }
                else
                {
                    instance.BookletID = hdnID;
                    Booklet.UpdateSelectedSeries(instance);
                }

            }
            catch (Exception ee)
            {
                isInsert = false;
                (Master as Frame).PopUp(ee.Message);
            }

            if (isInsert)
            {
                (Master as Frame).PopUp("Apply Success!");

                mvMain.SetActiveView(vwMain);
                CallDataGrid();
            }
        }
Exemple #5
0
        public static bool InsertNewSeries(Booklet instance)
        {
            var dal = new BookletDAL();

            return(dal.InsertNewSeries(instance));
        }
Exemple #6
0
        public static bool UpdateSelectedSeries(Booklet instance)
        {
            var dal = new BookletDAL();

            return(dal.UpdateSelectedSeries(instance));
        }
        public static bool InsertNewSeries(Booklet instance)
        {
            var dal = new BookletDAL();

            return dal.InsertNewSeries(instance);
        }
        public static List<Booklet> GetAllData()
        {
            var dal = new BookletDAL();
            var collection = new List<Booklet>();

            foreach(DataRow row in dal.GetAllData().Rows){
                var instance = new Booklet();

                instance.Bind(row);
                collection.Add(instance);
            }

            return collection;
        }
        public static bool UpdateSelectedSeries(Booklet instance)
        {
            var dal = new BookletDAL();

            return dal.UpdateSelectedSeries(instance);
        }
        public static Booklet SelectByID(int id)
        {
            var dal = new BookletDAL();

            DataRow row = dal.SelectByID(id);

            var instance = new Booklet();

            instance.Bind(row);

            return instance;
        }