예제 #1
0
        public ActionResult MainBannerDelete(MainBannerDetailModel model)
        {
            string html = null;

            try
            {
                int a = obj.FunExecuteNonQuery("exec dbo.BannerDetail_Delete '" + model.BannerId + "'");
                if (a > 0)
                {
                    DataTable dt = obj.FunDataTable("SELECT * from dbo.BannerDetail_Get ()");
                    if (dt.Rows.Count > 0)
                    {
                        int[]         columnHide = { 0 };
                        StringBuilder htmlTable  = CommonUtil.htmlTableImage(dt, columnHide);
                        return(Json(new { Flag = 0, Html = Convert.ToString(htmlTable) }, JsonRequestBehavior.AllowGet));
                    }
                    else
                    {
                        html = "<div class='alert alert-danger'>'" + Resources.Resource1.norecord + "'</div>";
                        return(Json(new { Flag = 0, Html = html }, JsonRequestBehavior.AllowGet));
                    }
                }
                else
                {
                    html = Resources.Resource1.deletefailed;
                    return(Json(new { Flag = 2, Html = html }, JsonRequestBehavior.AllowGet));
                }
            }
            catch (Exception ex)
            {
                html = Resources.Resource1.deletefailed;
                return(Json(new { Flag = 2, Html = html }, JsonRequestBehavior.AllowGet));
            }
        }
예제 #2
0
        public ActionResult MainBannerGet(MainBannerDetailModel model)
        {
            string html = null;

            try
            {
                DataTable dt = obj.FunDataTable("SELECT * from dbo.BannerDetail_Get ()");
                if (dt.Rows.Count > 0)
                {
                    int[]         columnHide = { 0 };
                    StringBuilder htmlTable  = CommonUtil.htmlTableImage(dt, columnHide);
                    return(Json(new { Flag = 0, Html = htmlTable.ToString() }, JsonRequestBehavior.AllowGet));
                }
                else
                {
                    html = "<div class='alert alert-danger'>'" + Resources.Resource1.norecord + "'</div>";
                    return(Json(new { Flag = 0, Html = html }, JsonRequestBehavior.AllowGet));
                }
            }
            catch (Exception ex)
            {
                html = "Fatch Result Failed !!!";
                return(Json(new { Flag = 2, Html = html }, JsonRequestBehavior.AllowGet));
            }
        }