Example #1
0
        public ActionResult Editdata1(int Id)
        {
            try
            {
                ViewBag.Saved = false;
                Models.TaxTitleModel data = new TaxTitleModel()
                {
                    TaxTitleId = 0
                };

                CLayer.TaxTitle staycategory = BLayer.TaxTitle.Get(Id);

                if (staycategory != null)
                {
                    data = new Models.TaxTitleModel()
                    {
                        TaxTitleId = staycategory.TaxTitleId,
                        Title      = staycategory.Title,
                        Status     = staycategory.Status
                    }
                }
                ;
                return(PartialView("~/Areas/Admin/Views/TaxTitle/_Edit.cshtml", data));
            }
            catch (Exception ex)
            {
                Common.LogHandler.HandleError(ex);
                return(Redirect("~/Admin/ErrorPage"));
            }
        }
Example #2
0
        public ActionResult Editdata1(Models.TaxTitleModel data)
        {
            try
            {
                if (ModelState.IsValid)
                {
                    CLayer.TaxTitle Ttitle = new CLayer.TaxTitle()
                    {
                        TaxTitleId = data.TaxTitleId,
                        Title      = data.Title,
                        Status     = data.Status
                    };
                    BLayer.TaxTitle.Save(Ttitle);

                    ViewBag.Saved = true;
                }
                else
                {
                    ViewBag.Saved = false;
                }
                return(RedirectToAction("Index"));
            }
            catch (Exception ex)
            {
                Common.LogHandler.HandleError(ex);
                return(Redirect("~/Admin/ErrorPage"));
            }
        }
Example #3
0
        public int Save(CLayer.TaxTitle taxTi)
        {
            List <DataPlug.Parameter> param = new List <DataPlug.Parameter>();

            param.Add(Connection.GetParameter("pTaxTitleId", DataPlug.DataType._Int, taxTi.TaxTitleId));
            param.Add(Connection.GetParameter("pTitle", DataPlug.DataType._Varchar, taxTi.Title));
            param.Add(Connection.GetParameter("pStatus", DataPlug.DataType._Int, taxTi.Status));
            int result = Connection.ExecuteQuery("TaxTitle_Save", param);

            return(result);
        }
Example #4
0
        public CLayer.TaxTitle GetById(int TaxTitleId)
        {
            CLayer.TaxTitle           taxTi = null;
            List <DataPlug.Parameter> param = new List <DataPlug.Parameter>();

            param.Add(Connection.GetParameter("pTaxTitleId", DataPlug.DataType._BigInt, TaxTitleId));
            DataTable dt = Connection.GetTable("TaxTitleById_Get", param);

            if (dt.Rows.Count > 0)
            {
                taxTi            = new CLayer.TaxTitle();
                taxTi.TaxTitleId = Connection.ToInteger(dt.Rows[0]["TaxTitleId"]);
                taxTi.Title      = Connection.ToString(dt.Rows[0]["Title"]);
                taxTi.Status     = Connection.ToInteger(dt.Rows[0]["Status"]);
            }
            return(taxTi);
        }
Example #5
0
 public static int Save(CLayer.TaxTitle t)
 {
     DataLayer.TaxTitle taxtitsave = new DataLayer.TaxTitle();
     t.Validate();
     return(taxtitsave.Save(t));
 }