本文整理汇总了C#中docsoft.jgrid类的典型用法代码示例。如果您正苦于以下问题:C# jgrid类的具体用法?C# jgrid怎么用?C# jgrid使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
jgrid类属于docsoft命名空间,在下文中一共展示了jgrid类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Render
protected override void Render(HtmlTextWriter writer)
{
var sb = new StringBuilder();
var cs = this.Page.ClientScript;
#region Tham số
HttpContext c = HttpContext.Current;
var listRow = new List<jgridRow>();
#endregion
switch (subAct)
{
case "get":
#region lấy dữ liệu cho grid
foreach (var item in KhachHangDal.SelectCongNo(false.ToString()))
{
listRow.Add(new jgridRow(item.ID.ToString(), new string[]
{
item.ID.ToString()
,item.Ten
, Lib.TienVietNam(item.CongNo)
}));
}
var gridSpAdm = new jgrid(string.IsNullOrEmpty(jgrpage) ? "1" : jgrpage
, "1"
, "1000"
, listRow);
sb.Append(JavaScriptConvert.SerializeObject(gridSpAdm));
break;
#endregion
case "scpt":
#region Nạp js
sb.AppendFormat(@"{0}"
, cs.GetWebResourceUrl(typeof(Class1), "appStore.commonStore.thuChiMgr.baoCaoCong.JScript1.js"));
//sb.AppendFormat(@"{0}"
// , cs.GetWebResourceUrl(typeof(Class1), "appStore.commonStore.thuChiMgr.baoCaoCong.Publish.js"));
break;
#endregion
default:
#region nạp
var listFn = FunctionDal.SelectByUserAndFNID(Security.Username, fnId);
sb.Append(Lib.GetResource(Assembly.GetExecutingAssembly(), "baoCaoCong.mdl.htm"));
sb.AppendFormat(@"<script>$.getScript('{0}',function(){1});</script>"
, cs.GetWebResourceUrl(typeof(Class1), "appStore.commonStore.thuChiMgr.baoCaoCong.JScript1.js")
, "{baoCaoCongFn.loadgrid();}");
sb.AppendFormat("<script>adm.validFn('{0}');</script>", JavaScriptConvert.SerializeObject(listFn));
break;
#endregion
}
writer.Write(sb.ToString());
base.Render(writer);
}
示例2: Render
protected override void Render(System.Web.UI.HtmlTextWriter writer)
{
StringBuilder sb = new StringBuilder();
ClientScriptManager cs = this.Page.ClientScript;
string _userName = Request["UserName"];
string _IP = Request["IPTruyCap"];
switch (subAct)
{
case "get":
#region lấy dữ liệu cho grid
if (string.IsNullOrEmpty(jgrsidx)) jgrsidx = "ID";
if (string.IsNullOrEmpty(jgrsord)) jgrsord = "asc";
Pager<Log> PagerGet = LogDal.pagerNormal("", false, "LOG_" + jgrsidx + " " + jgrsord,_userName,Convert.ToInt32(jgRows), null);
List<jgridRow> ListRow = new List<jgridRow>();
foreach (Log log in PagerGet.List)
{
ListRow.Add(new jgridRow(log.ID.ToString(), new string[] { log.ID.ToString(), log.LLOG_ID.ToString(), log.NgayTao.ToString(), log.Username, log.RawUrl, log.RequestIp }));
}
jgrid grid = new jgrid(string.IsNullOrEmpty(jgrpage) ? "1" : jgrpage, PagerGet.TotalPages.ToString(), PagerGet.Total.ToString(), ListRow);
sb.Append(JavaScriptConvert.SerializeObject(grid));
break;
#endregion
case "scpt":
#region Nạp js
sb.AppendFormat(@"{0}"
, cs.GetWebResourceUrl(typeof(Class1), "docsoft.plugin.hethong.quanlyLog.JScript1.js"));
break;
#endregion
default:
#region nạp
FunctionCollection ListFn = FunctionDal.SelectByUserAndFNID(Security.Username, fnId);
sb.Append(@"
<div id=""mdl-head"">
<input type=""text"" _value="""" class=""admtxt UserName""/><button class=""admfilter-btn""></button>
<input type=""text"" class=""admtxt-medium ui-corner-all IPTruyCap"" /><button class=""admSearch-btn""></button>
</div>
<table id=""quanlylogmdl-List"" class=""mdl-list""></table>
<div id=""quanlylogmdl-Pager""></div>");
sb.AppendFormat(@"<script>$.getScript('{0}',function(){1});</script>"
, cs.GetWebResourceUrl(typeof(Class1), "docsoft.plugin.hethong.quanlyLog.JScript1.js")
, "{quanlylog.loadgrid();}");
sb.AppendFormat("<script>adm.validFn('{0}');</script>", JavaScriptConvert.SerializeObject(ListFn));
break;
#endregion
}
writer.Write(sb.ToString());
base.Render(writer);
}
示例3: Render
protected override void Render(HtmlTextWriter writer)
{
StringBuilder sb = new StringBuilder();
ClientScriptManager cs = this.Page.ClientScript;
#region Tham số
string _ID = Request["ID"];
string _q = Request["q"];
string _dm = Request["dm"];
string _active = Request["active"];
string _publish = Request["publish"];
string _Lang = Request["Lang"];
string _dmkv = Request["dmkv"];
string _LangBased = Request["LangBased"];
string _LangBased_ID = Request["LangBased_ID"];
string _ckbMua = Request["ckbMua"];
string _Anh = Request["Anh"];
string _Ten = Request["Ten"];
string _MoTa = Request["MoTa"];
string _NoiDung = Request["NoiDung"];
string _NgayHetHan = Request["NgayHetHan"];
string _XuatXu = Request["XuatXu"];
string _Active = Request["Active"];
string _Publish = Request["Publish"];
string _Hot = Request["Hot"];
string _Hot1 = Request["Hot1"];
string _Hot2 = Request["Hot2"];
string _Hot3 = Request["Hot3"];
string _Hot4 = Request["Hot4"];
string _muaban = Request["muaban"];
string _trangthai = Request["trangthai"];
GiaoThuong Item;
List<GiaoThuong> List = new List<GiaoThuong>();
List<jgridRow> ListRow = new List<jgridRow>();
#endregion
switch (subAct)
{
case "ListDanhMucID":
#region load hỗ trợ đăng ký dịch vụ
if (!string.IsNullOrEmpty(_ID)) {
sb.Append(JavaScriptConvert.SerializeObject(DanhMucDal.SelectListDanhMucID(_ID)));
}
break;
#endregion
case "getByLangBasedId":
#region lấy dữ liệu ngôn ngữ phụ
List<GiaoThuong> listpg = GiaoThuongDal.SelectgetByLangBasedId(Convert.ToInt32(_LangBased_ID));
List<jgridRow> ListRowgetByLangBasedId = new List<jgridRow>();
foreach (GiaoThuong item in listpg)
{
ListRowgetByLangBasedId.Add(new jgridRow(item.ID.ToString(), new string[]{
item.ID.ToString()
,item.LangBased.ToString()
,item.Lang
,string.Format(@"<img src=""../up/i/{0}"" />",Lib.imgSize(item.Anh,"50x50"))
,item.Ten
,item.NoiDung
,item._DM_Ten
,item.XuatXu
,item.NgayTao.ToString("dd/MM/yyyy")
,item.NguoiTao
,item.Publish.ToString()
,item.Active.ToString()
}));
}
jgrid gridlang = new jgrid(string.IsNullOrEmpty(jgrpage) ? "1" : jgrpage, "1", listpg.Count.ToString(), ListRowgetByLangBasedId);
sb.Append(JavaScriptConvert.SerializeObject(gridlang));
break;
#endregion
case "get":
#region lấy dữ liệu cho grid
Pager<GiaoThuong> PagerGet = GiaoThuongDal.pagerNormal("", false, jgrsidx + " " + jgrsord, _q, _dm,Security.Username, "False", _publish, _Lang, Convert.ToInt32(jgRows), _dmkv, _muaban, "");
foreach (GiaoThuong item in PagerGet.List)
{
ListRow.Add(new jgridRow(item.ID.ToString(), new string[]{
item.ID.ToString()
,item.LangBased.ToString()
,item.Lang
,string.Format(@"<img src=""../up/i/{0}"" />",Lib.imgSize(item.Anh,"50x50"))
,item.Ten
,item.NoiDung
,item._DM_Ten
,item.XuatXu
,item.NgayTao.ToString("dd/MM/yyyy")
,item.NguoiTao
,item.Publish.ToString()
,item.Active.ToString()
}));
}
jgrid grid = new jgrid(string.IsNullOrEmpty(jgrpage) ? "1" : jgrpage
, List.Count.ToString()
, List.Count.ToString()
, ListRow);
sb.Append(JavaScriptConvert.SerializeObject(grid));
break;
#endregion
case "del":
#region xóa
//.........这里部分代码省略.........
示例4: Render
protected override void Render(HtmlTextWriter writer)
{
StringBuilder sb = new StringBuilder();
ClientScriptManager cs = this.Page.ClientScript;
#region Tham số
string _ID = Request["ID"];
string _B_ID = Request["B_ID"];
string _DM_ID = Request["DM_ID"];
string _RssUrl = Request["RssUrl"];
Channel ItemSave;
#endregion
switch (subAct)
{
case "get":
#region lấy dữ liệu cho grid
List<jgridRow> ListRow = new List<jgridRow>();
ChannelCollection List = ChannelDal.SelectByDmIdByBid(_DM_ID, _B_ID);
foreach (Channel dm in List)
{
ListRow.Add(new jgridRow(dm.ID.ToString(), new string[] {
string.Format("{0}",dm.ID)
, dm.B_Ten
, dm.DM_Ten
, dm.RssUrl
}));
}
jgrid grid = new jgrid(string.IsNullOrEmpty(jgrpage) ? "1" : jgrpage, List.Count.ToString(), List.Count.ToString(), ListRow);
sb.Append(JavaScriptConvert.SerializeObject(grid));
break;
#endregion
case "del":
#region xóa
if (!string.IsNullOrEmpty(_ID))
{
ChannelDal.DeleteById(Convert.ToInt32(_ID));
}
break;
#endregion
case "edit":
#region chỉnh sửa
if (!string.IsNullOrEmpty(_ID))
{
sb.Append("(" + JavaScriptConvert.SerializeObject(ChannelDal.SelectById(Convert.ToInt32(_ID))) + ")");
}
break;
#endregion
case "save":
#region lưu
if (!string.IsNullOrEmpty(_ID))
{
ItemSave = ChannelDal.SelectById(Convert.ToInt32(_ID));
}
else
{
ItemSave = new Channel();
}
if (!string.IsNullOrEmpty(_B_ID))
{
ItemSave.B_ID = Convert.ToInt32(_B_ID);
}
if (!string.IsNullOrEmpty(_DM_ID))
{
ItemSave.DM_ID = Convert.ToInt32(_DM_ID);
}
ItemSave.RssUrl = _RssUrl;
if (!string.IsNullOrEmpty(_ID))
{
ItemSave = ChannelDal.Update(ItemSave);
}
else
{
ItemSave = ChannelDal.Insert(ItemSave);
}
sb.Append("1");
break;
#endregion
case "getautoComplete":
#region Lấy danh sách danh mục
sb.Append(JavaScriptConvert.SerializeObject(docbao.entitites.DanhMucDal.SelectAll()));
break;
#endregion
case "getautoCompletePid":
#region Lấy danh sách danh mục
sb.Append(JavaScriptConvert.SerializeObject(docbao.entitites.DanhMucDal.SelectPid()));
break;
#endregion
case "scpt":
#region Nạp js
sb.AppendFormat(@"{0}"
, cs.GetWebResourceUrl(typeof(Class1), "plugin.rss.kenhRss.JScript1.js"));
break;
#endregion
default:
#region nạp
FunctionCollection ListFn = FunctionDal.SelectByUserAndFNID(Security.Username, fnId);
sb.Append(@"<div class=""mdl-head"">
<span class=""mdl-head-searchPnl ui-state-default ui-corner-all"">
<a href=""javascript:;"" class=""mdl-head-clearSearch""></a>
<input type=""text"" class=""mdl-head-txt mdl-head-search mdl-head-search-kenhRssMdl"" />
//.........这里部分代码省略.........
示例5: Render
protected override void Render(HtmlTextWriter writer)
{
var sb = new StringBuilder();
var cs = this.Page.ClientScript;
#region Tham số
var ID = Request["ID"];
var DM_ID = Request["DM_ID"];
var DM_Ten = Request["DM_Ten"];
var DV_ID = Request["DV_ID"];
var DV_Ten = Request["DV_Ten"];
var SoLuong = Request["SoLuong"];
var ThuTu = Request["ThuTu"];
var MoTa = Request["MoTa"];
string q = Request["q"];
#endregion
switch (subAct)
{
case "getSub":
#region lấy dữ liệu cho grid
if (string.IsNullOrEmpty(jgrsidx)) jgrsidx = "ID";
if (string.IsNullOrEmpty(jgrsord)) jgrsord = "asc";
var listSub = TinhTrangDichVuDal.SelectDmId(DM_ID);
var listRowSub = listSub.Select(item => new jgridRow(item.ID.ToString(), new string[]
{
item.ID.ToString(),
item.ThuTu.ToString(),
item.DV_Ten,
item.SoLuong.ToString()
})).ToList();
var gridSub = new jgrid(string.IsNullOrEmpty(jgrpage) ? "1" : jgrpage, "0", "0", listRowSub);
sb.Append(JavaScriptConvert.SerializeObject(gridSub));
break;
#endregion
case "saveSub":
#region lưu
var itemSub = new TinhTrangDichVu();
if (!string.IsNullOrEmpty(ID))
{
itemSub = TinhTrangDichVuDal.SelectById(new Guid(ID));
}
else
{
itemSub.ID = Guid.NewGuid();
}
if (!string.IsNullOrEmpty(DM_ID))
{
itemSub.DM_ID = new Guid(DM_ID);
}
if (!string.IsNullOrEmpty(DV_ID))
{
itemSub.DV_ID = new Guid(DV_ID);
}
itemSub.SoLuong = Convert.ToInt32(SoLuong);
itemSub.NgayCapNhat = DateTime.Now;
itemSub.NguoiCapNhat = Security.Username;
itemSub.ThuTu = Convert.ToInt32(ThuTu);
if (!string.IsNullOrEmpty(ID))
{
itemSub = TinhTrangDichVuDal.Update(itemSub);
}
else
{
itemSub.NgayTao = DateTime.Now;
itemSub.NguoiTao = Security.Username;
itemSub = TinhTrangDichVuDal.Insert(itemSub);
}
sb.Append("1");
break;
#endregion
case "editSub":
#region chỉnh sửa
if (!string.IsNullOrEmpty(ID))
{
sb.AppendFormat("({0})", JavaScriptConvert.SerializeObject(TinhTrangDichVuDal.SelectById(new Guid(ID))));
}
break;
#endregion
case "delSub":
#region xóa
if (!string.IsNullOrEmpty(ID))
{
TinhTrangDichVuDal.DeleteById(new Guid(ID));
}
break;
#endregion
case "getByDmId":
#region lấy dữ liệu cho grid
sb.Append(JavaScriptConvert.SerializeObject(TinhTrangDichVuDal.SelectDmId(DM_ID)));
break;
#endregion
case "scpt":
#region Nạp js
sb.AppendFormat(@"{0}"
, cs.GetWebResourceUrl(typeof(Class1), "appStore.pmSpa.tinhTrangDichVuMgr.JScript1.js"));
break;
#endregion
default:
//.........这里部分代码省略.........
示例6: Render
protected override void Render(HtmlTextWriter writer)
{
var sb = new StringBuilder();
var cs = this.Page.ClientScript;
#region Tham số
HttpContext c = HttpContext.Current;
var TuNgay = c.Request["TuNgay"];
var DenNgay = c.Request["DenNgay"];
var dNow = DateTime.Now;
var dauThang = new DateTime(dNow.Year, 1, 1).ToString("yyyy-MM-dd");
var cuoiThang = new DateTime(dNow.Year, dNow.Month, 1).AddMonths(1).AddDays(-1).ToString("yyyy-MM-dd");
TuNgay = string.IsNullOrEmpty(TuNgay) ? dauThang : Convert.ToDateTime(TuNgay, new CultureInfo("vi-Vn")).ToString("yyyy-MM-dd");
DenNgay = string.IsNullOrEmpty(DenNgay) ? cuoiThang : Convert.ToDateTime(DenNgay, new CultureInfo("vi-Vn")).ToString("yyyy-MM-dd");
var _q = c.Request["q"];
List<jgridRow> ListRow = new List<jgridRow>();
var danhMucKyHieuChi = DanhMucDal.SelectByMa("TC-CHI");
var danhMucKyHieuThu = DanhMucDal.SelectByMa("TC-THU");
#endregion
switch (subAct)
{
case "get":
#region lấy dữ liệu cho grid
var pagerGet = ThuChiReportDal.SelectTuNgayDenNgay(TuNgay, DenNgay);
var prefixMaChi = danhMucKyHieuChi.KyHieu;
var prefixMaThu = danhMucKyHieuThu.KyHieu;
foreach (var item in pagerGet)
{
ListRow.Add(new jgridRow(item.ma.ToString(), new string[]
{
item.ma.ToString()
,
item.sophieu == "0" ? "" : string.Format("{0}{1}",
(item.isthu
? prefixMaThu
: prefixMaChi),
item.sophieu)
, item.diengiai
, Lib.TienVietNam(item.thu_tk)
, Lib.TienVietNam(item.thu_tm)
, Lib.TienVietNam(item.thu_t)
, Lib.TienVietNam(item.chi_tk)
, Lib.TienVietNam(item.chi_tm)
, Lib.TienVietNam(item.chi_t)
, Lib.TienVietNam(item.tt_tk)
, Lib.TienVietNam(item.tt_tm)
, Lib.TienVietNam(item.tt_t)
, Lib.TienVietNam(item.sodu_tk)
, Lib.TienVietNam(item.sodu_tm)
, Lib.TienVietNam(item.sodu_t)
, item.loaiquy.ToString()
, item.isthu.ToString()
, item.isCandoi.ToString()
, item.ngay
, item.NguoiTao
}));
}
jgrid gridSPAdm = new jgrid(string.IsNullOrEmpty(jgrpage) ? "1" : jgrpage
, "1"
, pagerGet.Count.ToString()
, ListRow);
sb.Append(JavaScriptConvert.SerializeObject(gridSPAdm));
break;
#endregion
case "scpt":
#region Nạp js
sb.AppendFormat(@"{0}"
, cs.GetWebResourceUrl(typeof(Class1), "appStore.commonStore.thuChiMgr.baoCaoThuChi.JScript1.js"));
//sb.AppendFormat(@"{0}"
// , cs.GetWebResourceUrl(typeof(Class1), "appStore.commonStore.thuChiMgr.baoCaoThuChi.Publish.js"));
break;
#endregion
default:
#region nạp
var listFn = FunctionDal.SelectByUserAndFNID(Security.Username, fnId);
sb.Append(Lib.GetResource(Assembly.GetExecutingAssembly(), "baoCaoThuChi.mdl.htm"));
sb.AppendFormat(@"<script>$.getScript('{0}',function(){1});</script>"
, cs.GetWebResourceUrl(typeof(Class1), "appStore.commonStore.thuChiMgr.baoCaoThuChi.JScript1.js")
, "{baoCaoThuChiFn.loadgrid();}");
sb.AppendFormat("<script>adm.validFn('{0}');</script>", JavaScriptConvert.SerializeObject(listFn));
break;
#endregion
}
writer.Write(sb.ToString());
base.Render(writer);
}
示例7: Render
protected override void Render(System.Web.UI.HtmlTextWriter writer)
{
StringBuilder sb = new StringBuilder();
ClientScriptManager cs = this.Page.ClientScript;
#region Tham số
string _id = Request["ID"];
string _gh_id = Request["GH_ID"];
string _chude_id = Request["ChuDe_ID"];
string _chude_ten = Request["TenChuDe"];
string _ten = Request["Ten"];
string _thutu = Request["Thutu"];
string _mota = Request["Mota"];
string _anh = Request["UrlImage"];
string _duyet = Request["Duyet"];
string _clip = Request["Url"];
string _cq_id = Request["CQ_ID"];
string _active = Request["Active"];
string _q = Request["q"];
#endregion
switch (subAct)
{
case "getVideo":
#region lấy danh sách
string _NguoiTao = Security.Username;
if (string.IsNullOrEmpty(jgRows)) jgRows = "5";
if (string.IsNullOrEmpty(jgrsidx)) jgrsidx = "Thutu";
if (string.IsNullOrEmpty(jgrsord)) jgrsord = "asc";
Pager<VideoClip> PagerGet = VideoClipDal.pagerNormal("", false, jgrsidx + " " + jgrsord, _q, Request["rows"], _gh_id, _chude_id, _active);
List<jgridRow> ListRow = new List<jgridRow>();
foreach (VideoClip item in PagerGet.List)
{
ListRow.Add(new jgridRow(item.ID.ToString(), new string[]{
item.ID.ToString()
,string.Format(item.Thutu.ToString()==null?"":item.Thutu.ToString())
,string.Format("<img class=\"adm-pro-icon\" src=\"../up/v/{0}\" />", string.IsNullOrEmpty(item.UrlImage) ? "no-image.png" :item.UrlImage)
,string.Format(item.Ten.ToString()==null?"":item.Ten.ToString())
,string.Format(item.Mota.ToString()==null?"":item.Mota.ToString())
,string.Format(item.SoLuotXem.ToString()==null?"":item.SoLuotXem.ToString())
,DanhMucDal.SelectById(item.ChuDe_ID).Ten.ToString()
,item.Ngaytao.ToString("dd/MM/yy")
,item.NguoiTao
,item.Active.ToString()
}));
}
jgrid grid = new jgrid(string.IsNullOrEmpty(jgrpage) ? "1" : jgrpage, PagerGet.TotalPages.ToString(), PagerGet.Total.ToString(), ListRow);
sb.Append(JavaScriptConvert.SerializeObject(grid));
break;
#endregion
case "saveVideo":
#region lưu dữ liệu
VideoClip ItemSave = new VideoClip();
if (!string.IsNullOrEmpty(_id))
{
ItemSave = VideoClipDal.SelectById(Convert.ToInt32(_id));
}
ItemSave.Ten = _ten;
ItemSave.ChuDe_ID = int.Parse(_chude_id);
ItemSave.Mota = string.IsNullOrEmpty(_mota) ? "" : _mota;
ItemSave.Active = Convert.ToBoolean(_duyet);
ItemSave.UrlImage = _anh;
ItemSave.Url = _clip;
ItemSave.Thutu = Convert.ToInt16(_thutu);
ItemSave.Loai = 1;
ItemSave.Keyword = "";
ItemSave.CateID = 0;
// ItemSave.PID = Convert.ToInt32(_PID);
if (!string.IsNullOrEmpty(_id))
{
ItemSave.NguoiTao = Security.Username;
ItemSave.Ngaytao = DateTime.Now;
ItemSave = VideoClipDal.Update(ItemSave);
}
else
{
ItemSave.SoLuotXem = 0;
ItemSave.NguoiTao = Security.Username;
ItemSave.Ngaytao = DateTime.Now;
ItemSave.RowId = Guid.NewGuid();
ItemSave = VideoClipDal.Insert(ItemSave);
}
sb.Append("1");
break;
#endregion
case "delVideo":
#region xóa
if (!string.IsNullOrEmpty(_id))
{
char[] step = { ',' };
string[] arrID = _id.Split(step);
for (int i = 0; i < arrID.Length; i++)
{
VideoClip o = new VideoClip();
o = VideoClipDal.SelectById(Convert.ToInt32(arrID[i]));
try
//.........这里部分代码省略.........
示例8: Render
protected override void Render(HtmlTextWriter writer)
{
var sb = new StringBuilder();
var cs = this.Page.ClientScript;
#region Variables
var ID = Request["ID"];
var Ma = Request["Ma"];
var Ten = Request["Ten"];
var Ho = Request["Ho"];
var XungHo = Request["XungHo"];
var NgaySinh = Request["NgaySinh"];
var GioiTinh = Request["GioiTinh"];
var Email = Request["Email"];
var Mobile = Request["Mobile"];
var Phone = Request["Phone"];
var CMND = Request["CMND"];
var Ym = Request["Ym"];
var FacebookUid = Request["FacebookUid"];
var LinhVuc_ID = Request["LinhVuc_ID"];
var NguonGoc_ID = Request["NguonGoc_ID"];
var NguonGoc_ChiTiet_ID = Request["NguonGoc_ChiTiet_ID"];
var DiaChi = Request["DiaChi"];
var KhuVuc_ID = Request["KhuVuc_ID"];
var NgayTao = Request["NgayTao"];
var NguoiTao = Request["NguoiTao"];
var NgayCapNhat = Request["NgayCapNhat"];
var NguoiCapNhat = Request["NguoiCapNhat"];
var NgungTheoDoi = Request["NgungTheoDoi"];
var NoiBat = Request["NoiBat"];
var ChiaSe = Request["ChiaSe"];
var DanhGia = Request["DanhGia"];
var KhongNhanEmail = Request["KhongNhanEmail"];
var KhongDuocGoiDien = Request["KhongDuocGoiDien"];
var ThoiGianGoiDien = Request["ThoiGianGoiDien"];
var NguoiGioiThieu = Request["NguoiGioiThieu"];
var TuVanVien = Request["TuVanVien"];
var EmailTitle = Request["EmailTitle"];
var EmailBody = Request["EmailBody"];
var _q = Request["q"];
#endregion
var ListRow = new List<jgridRow>();
switch (subAct)
{
case "get":
#region get
var pagerGet = KhachHangDal.pagerNormal("", false, "a.KH_" + jgrsidx + " " + jgrsord, _q, Convert.ToInt32(jgRows), KhuVuc_ID,NguonGoc_ID);
foreach (var item in pagerGet.List)
{
ListRow.Add(new jgridRow(item.ID.ToString(), new string[] {
item.ID.ToString()
, item.Ma
, item.Ten
, item.Mobile
, item.Email
, item.GioiTinh ? "Nam" : "Nữ"
, item.Ym
, item.NgaySinh.ToString("dd/MM/yy")
, item.KhuVuc_Ten
, item.NguonGoc_Ten
, string.Format("{0:dd/MM/yy}",item.NgayCapNhat
)
}));
}
jgrid gridSPAdm = new jgrid(string.IsNullOrEmpty(jgrpage) ? "1" : jgrpage
, pagerGet.TotalPages.ToString()
, pagerGet.Total.ToString()
, ListRow);
sb.Append(JavaScriptConvert.SerializeObject(gridSPAdm));
break;
#endregion
case "save":
#region chỉnh sửa
if (Security.IsAuthenticated())
{
var item = new KhachHang();
if (!string.IsNullOrEmpty(ID))
{
item = KhachHangDal.SelectById(new Guid(ID));
}
else
{
if(string.IsNullOrEmpty(Ma))
{
Ma = CaptchaImage.GenerateRandomCode(CaptchaType.Numeric, 10);
}
}
item.CMND = CMND;
item.DiaChi = DiaChi;
item.Email = Email;
item.GioiTinh = Convert.ToBoolean(GioiTinh);
if (!string.IsNullOrEmpty(KhuVuc_ID))
{
item.KhuVuc_ID = new Guid(KhuVuc_ID);
}
item.Ma = Ma;
item.Mobile = Mobile;
//.........这里部分代码省略.........
示例9: Render
protected override void Render(HtmlTextWriter writer)
{
StringBuilder sb = new StringBuilder();
ClientScriptManager cs = this.Page.ClientScript;
#region tham so
string _ID = Request["ID"];
string _PRowId = Request["PRowId"];
string _PID = Request["PID"];
string _Ten = Request["Ten"];
string _DiaChi = Request["DiaChi"];
string _CongTy = Request["CongTy"];
string _Email = Request["Email"];
string _DienThoai = Request["DienThoai"];
//string _Phone = Request["Phone"];
string _Skype = Request["Skype"];
string _Ym = Request["Ym"];
string _Website = Request["Website"];
string _Active = Request["Active"];
string _RowId = Request["RowId"];
string _q = Request["q"];
#endregion
switch (subAct)
{
case "get":
#region Get du lieu cho Grid
if (string.IsNullOrEmpty(jgrsidx)) jgrsidx = "ID";
if (string.IsNullOrEmpty(jgrsord)) jgrsord = "desc";
Pager<LienHe> PagerGet = LienHeDal.pagerNormal("", false, "LH_" + jgrsidx + " " + jgrsord, _q, Request["rows"]);
List<jgridRow> ListRow = new List<jgridRow>();
foreach (LienHe lh in PagerGet.List)
{
ListRow.Add(new jgridRow(lh.ID.ToString(),
new string[] {
lh.ID.ToString()
,lh.Ten
,lh.DiaChi
,lh.CongTy
,lh.Email
,lh.Mobile
,lh.Skype
,lh.Ym
,lh.Website
,lh.Active.ToString()
}));
}
jgrid grid = new jgrid(string.IsNullOrEmpty(jgrpage) ? "1" : jgrpage, PagerGet.TotalPages.ToString(), PagerGet.Total.ToString(), ListRow);
sb.Append(JavaScriptConvert.SerializeObject(grid));
break;
#endregion
case "edit":
#region Sua mau tin
if (!string.IsNullOrEmpty(_ID))
{
sb.Append("(" + JavaScriptConvert.SerializeObject(LienHeDal.SelectById(Convert.ToInt32(_ID))) + ")");
}
break;
#endregion
case "del":
#region xóa
if (!string.IsNullOrEmpty(_ID))
{
//LienHeDal.DeleteByIdList(_ID);
LienHeDal.DeleteById(Convert.ToInt32(_ID));
}
break;
#endregion
case "save":
#region luu thong tin
LienHe ItemSave = new LienHe();
if (string.IsNullOrEmpty(_Ten))
{
sb.Append("0");
break;
}
if (!string.IsNullOrEmpty(_ID))
{
ItemSave = LienHeDal.SelectById(Convert.ToInt32(_ID));
}
ItemSave.Ten = _Ten;
ItemSave.DiaChi = _DiaChi;
ItemSave.CongTy = _CongTy;
ItemSave.Email = _Email;
ItemSave.Mobile = _DienThoai;
ItemSave.Skype = _Skype;
ItemSave.Ym = _Ym;
ItemSave.Website = _Website;
ItemSave.Active =Convert.ToBoolean(_Active);
ItemSave.PRowId = Guid.NewGuid();
if (!string.IsNullOrEmpty(_ID))
{
ItemSave.NguoiCapNhat = Security.Username;
ItemSave.NgayCapNhat = DateTime.Now;
//ItemSave.NgayTao =ItemSave.NgayTao;
ItemSave = LienHeDal.Update(ItemSave);
//.........这里部分代码省略.........
示例10: Render
protected override void Render(HtmlTextWriter writer)
{
StringBuilder sb = new StringBuilder();
ClientScriptManager cs = this.Page.ClientScript;
#region Tham số
string _ID = Request["ID"];
string _Duyet = Request["Duyet"];
string _Khoa = Request["Khoa"];
string _q = Request["q"];
List<jgridRow> ListRow = new List<jgridRow>();
ThanhToan Item;
string Username = Security.Username;
bool logged = Security.IsAuthenticated();
#endregion
switch (subAct)
{
case "get":
#region lấy dữ liệu cho grid
if (string.IsNullOrEmpty(jgrsidx)) jgrsidx = "ID";
if (string.IsNullOrEmpty(jgrsord)) jgrsord = "asc";
Pager<ThanhToan> PagerGet = ThanhToanDal.pagerYeuCau("T_" + jgrsidx + " " + jgrsord, Convert.ToInt32(jgRows));
foreach (ThanhToan item in PagerGet.List)
{
ListRow.Add(new jgridRow(item.ID.ToString(),
new string[] {
item.ID.ToString(),
item.NguoiYeuCau,
item.SoDu.ToString("C",new CultureInfo("vi-Vn")),
item.NgayTao.ToString("hh:mm dd/MM/yy")
}));
}
jgrid grid = new jgrid(string.IsNullOrEmpty(jgrpage) ? "1" : jgrpage, PagerGet.TotalPages.ToString(), PagerGet.Total.ToString(), ListRow);
sb.Append(JavaScriptConvert.SerializeObject(grid));
break;
#endregion
case "duyet":
#region duyet
if (!string.IsNullOrEmpty(_ID))
{
using (SqlConnection con = DAL.con())
{
con.Open();
SqlTransaction tran = con.BeginTransaction();
try
{
bool Khoa = Convert.ToBoolean(_Khoa);
double total;
TaiKhoan tkItem;
foreach (string item in _ID.Split(new char[] { ',' }))
{
if (item.Length > 0)
{
total = 0;
Item = ThanhToanDal.SelectById(Convert.ToInt32(item), tran);
tkItem = TaiKhoanDal.SelectByUsername(Item.NguoiYeuCau, tran);
if (!string.IsNullOrEmpty(tkItem.Tk))
{
total = Convert.ToDouble(maHoa.DecryptString(tkItem.Tk, tkItem.Username));
}
if (Khoa)
{
if (!Item.Duyet)
{
total = total - Convert.ToDouble(Item.SoDu);
}
}
ThanhToanDal.Duyet(item, _Khoa, tran);
TaiKhoanDal.UpdateTk(tkItem.ID, maHoa.EncryptString(total.ToString(), Item.NguoiYeuCau), tran);
}
}
tran.Commit();
}
catch (Exception ex)
{
tran.Rollback();
sb.Append(ex.ToString());
}
finally
{
con.Close();
}
}
}
break;
#endregion
case "scpt":
#region Nạp js
sb.AppendFormat(@"{0}"
, cs.GetWebResourceUrl(typeof(Class1), "seo.plugin.thanhToanMgr.yeuCau.JScript1.js"));
break;
#endregion
default:
#region nạp
FunctionCollection ListFn = FunctionDal.SelectByUserAndFNID(Security.Username, fnId);
if (!logged)
{
renderText("un-authorized", "text/plain");
}
//.........这里部分代码省略.........
示例11: Render
protected override void Render(HtmlTextWriter writer)
{
#region biến
StringBuilder sb = new StringBuilder();
ClientScriptManager cs = this.Page.ClientScript;
string _ID = Request["ID"];
string _F_ID = Request["F_ID"];
string _Lang = Request["Lang"];
string _Alias = Request["Alias"];
string _LangBased_ID = Request["LangBased_ID"];
string _LangBased = Request["LangBased"];
string _KeyWords = Request["KeyWords"];
string _Description = Request["Description"];
string _PID = Request["DMID"];
string _PTen = Request["DMTen"];
string _Ten = Request["Ten"];
string _Mota = Request["Mota"];
string _NoiDung_tt = Request["NoiDung_tt"];
string _ThuTu = Request["ThuTu"];
string _Anh = Request["Anh"];
string _Hot = Request["Hot"];
string _q = Request["q"];
string _HetHan = Request["HetHan"];
string _NgayHetHan = Request["NgayHetHan"];
string _NgayCapNhat = Request["NgayCapNhat"];
string _Status = Request["Status"];
string _Nguon = Request["Nguon"];
List<jgridRow> ListRow;
#endregion
switch (subAct)
{
case "get":
#region lấy danh sách
if (string.IsNullOrEmpty(jgrsidx)) jgrsidx = "TIN_NgayCapNhat";
if (string.IsNullOrEmpty(jgrsord)) jgrsord = "desc";
string _NguoiTao = Security.Username;
var admin = false;
var pagerGet = TinDal.PagerQuanTri(string.Empty, false, Convert.ToInt32(jgRows), jgrsidx + " " + jgrsord, _PID, _q, false, Security.Username, true, false);
ListRow = new List<jgridRow>();
foreach (Tin item in pagerGet.List)
{
ListRow.Add(new jgridRow(item.ID.ToString(), new string[] {
item.ID.ToString()
,item.LangBased.ToString()
,item._ID.ToString()
,item.Lang
,item.ThuTu.ToString()
,string.Format("<img src=\"../up/tintuc/{0}?ref=\" style=\"width:50px;height:50px; \"/>",item.Anh, Guid.NewGuid())
, string.Format(@"<a target=""_blanks"" href=""{0}/lib/pages/?pages=Tin-tuc-view&TIN-ID={1}"">{2}</a>",domain,item.ID,item.Ten)
,item.MoTa
,item.DM_Ten
,item.Views.ToString()
,item.NguoiTao
,item.NgayTao.ToString("HH:mm dd/MM/yyyy")
,item.Active.ToString()
,item.Hot.ToString()
,item.HetHan.ToString()
}));
}
jgrid grid = new jgrid(string.IsNullOrEmpty(jgrpage) ? "1" : jgrpage, pagerGet.TotalPages.ToString(), pagerGet.Total.ToString(), ListRow);
//jgrid grid = new jgrid("1", "1", pager.Total.ToString(), ListRow);
sb.Append(JavaScriptConvert.SerializeObject(grid));
break;
#endregion
case "edit":
#region chỉnh sửa
if (!string.IsNullOrEmpty(_ID))
{
sb.AppendFormat("({0})", JavaScriptConvert.SerializeObject(TinDal.SelectByIdView(_ID)));
}
break;
#endregion
case "del":
#region Xóa
if (!string.IsNullOrEmpty(_ID))
{
TinDal.DeleteMultiById(_ID, "TIN_TUC");
}
break;
#endregion
case "duyet":
#region Duyệt tin hàng loạt
var itemDuyet = new Tin();
if (!string.IsNullOrEmpty(_ID))
{
itemDuyet.multiID = _ID;
itemDuyet.Active = Convert.ToBoolean(_Status);
TinDal.UpdateMulti(itemDuyet);
}
sb.Append("1");
break;
#endregion
case "yeuCauDuyet":
#region Duyệt tin hàng loạt
var itemyeuCauDuyet = new Tin();
if (!string.IsNullOrEmpty(_ID))
{
itemyeuCauDuyet.multiID = _ID;
//.........这里部分代码省略.........
示例12: Render
protected override void Render(HtmlTextWriter writer)
{
StringBuilder sb = new StringBuilder();
ClientScriptManager cs = this.Page.ClientScript;
#region Tham số
string _ID = Request["ID"];
string _PID = Request["PID"];
string _LDMID = Request["LDMID"];
string _Lang = Request["Lang"];
string _Ten = Request["Ten"];
string _Alias = Request["Alias"];
string _Ma = Request["Ma"];
string _KyHieu = Request["KyHieu"];
string _GiaTri = Request["GiaTri"];
string _KeyWords = Request["KeyWords"];
string _Description = Request["Description"];
string _LangBased_ID = Request["LangBased_ID"];
string _ThuTu = Request["ThuTu"];
string _Anh = Request["Anh"];
string _LangBased = Request["LangBased"];
string _q = Request["q"];
string _LDM_Ma = Request["LDM_Ma"];
if (_PID == "0")
_PID = string.Empty;
DanhMuc Item;
List<DanhMuc> List=new List<DanhMuc>();
#endregion
switch (subAct)
{
case "get":
#region lấy dữ liệu cho grid
List = getTree(DanhMucDal.SelectByLDMID(_LDMID));
var listRow = List.Select(dm => new jgridRow(dm.ID.ToString(), new string[]
{
dm.ID.ToString(), dm.LangBased.ToString(), dm.ID.ToString(), dm.Lang, dm.ThuTu.ToString(), dm.LDM_Ten, dm.Ma, dm.KyHieu, dm.GiaTri, string.Format("<img class=\"adm-fn-icon\" src=\"../up/i/{0}?ref=\" />", string.IsNullOrEmpty(dm.Anh) ? "fn-icon.jpg" : dm.Anh, Guid.NewGuid().ToString().Replace("-", "")), dm.Ten, string.Format("{0:dd/MM/yy}", dm.NgayCapNhat), dm.NguoiTao + "/" + dm.NguoiSua, dm.Level.ToString(), dm.PID.ToString(), "true", "true"
})).ToList();
var grid = new jgrid(string.IsNullOrEmpty(jgrpage) ? "1" : jgrpage, List.Count.ToString(), List.Count.ToString(), listRow);
sb.Append(JavaScriptConvert.SerializeObject(grid));
break;
#endregion
case "getByMa":
#region lấy dữ liệu cho grid
List = getTree(DanhMucDal.SelectByLDMMa(_LDM_Ma));
var listRowByMa = List.Select(dm => new jgridRow(dm.ID.ToString(), new string[]
{
dm.ID.ToString(), dm.LangBased.ToString(), dm.ID.ToString(), dm.Lang, dm.ThuTu.ToString(), dm.LDM_Ten, dm.Ma, dm.KyHieu, dm.GiaTri, string.Format("<img class=\"adm-fn-icon\" src=\"../up/i/{0}?ref=\" />", string.IsNullOrEmpty(dm.Anh) ? "fn-icon.jpg" : dm.Anh, Guid.NewGuid().ToString().Replace("-", "")), dm.Ten, string.Format("{0:dd/MM/yy}", dm.NgayCapNhat), dm.NguoiTao + "/" + dm.NguoiSua, dm.Level.ToString(), dm.PID.ToString(), "true", "true"
})).ToList();
var gridByMa = new jgrid(string.IsNullOrEmpty(jgrpage) ? "1" : jgrpage, List.Count.ToString(), List.Count.ToString(), listRowByMa);
sb.Append(JavaScriptConvert.SerializeObject(gridByMa));
break;
#endregion
case "del":
#region xóa
if (!string.IsNullOrEmpty(_ID))
{
DanhMucDal.DeleteById(new Guid(_ID));
}
break;
#endregion
case "autoCompleteLangBased":
#region xóa
sb.Append(JavaScriptConvert.SerializeObject(getTree(DanhMucDal.SelectByLDMMa(_LDM_Ma))));
break;
#endregion
case "autoCompleteLangBasedNoChild":
#region xóa
var list1 = DanhMucDal.SelectByLDMMa(_LDM_Ma);
var list2 = from p in list1
where p.PID==Guid.Empty
select p;
sb.Append(JavaScriptConvert.SerializeObject(getTree(list2.ToList())));
break;
#endregion
case "autoCompleteByPid":
#region xóa
sb.Append(JavaScriptConvert.SerializeObject(DanhMucDal.SelectByPid(_ID)));
break;
#endregion
case "autoCompleteLdmMa":
#region xóa
sb.Append(JavaScriptConvert.SerializeObject(getTree(DanhMucDal.SelectByLDMMa(_LDM_Ma))));
break;
#endregion
case "autoCompleteLangBasedByDM":
#region xóa
sb.Append(JavaScriptConvert.SerializeObject(getTree(DanhMucDal.SelectTreeByDmMa(DAL.con(), _Ma))));
break;
#endregion
case "edit":
#region chỉnh sửa
if (!string.IsNullOrEmpty(_ID))
{
sb.AppendFormat("({0})", JavaScriptConvert.SerializeObject(DanhMucDal.SelectById(new Guid(_ID))));
}
break;
#endregion
case "save":
#region lưu
//.........这里部分代码省略.........
示例13: Render
protected override void Render(HtmlTextWriter writer)
{
var sb = new StringBuilder();
var cs = this.Page.ClientScript;
#region Variables
var ID = Request["ID"];
var KM_ID = Request["KM_ID"];
var Ma = Request["Ma"];
var KH_ID = Request["KH_ID"];
var DVTC_ID = Request["DVTC_ID"];
var GiaNY = Request["GiaNY"];
var Gia = Request["Gia"];
var HanSuDung = Request["HanSuDung"];
var HanDoiThe = Request["HanDoiThe"];
var TinhTrang = Request["TinhTrang"];
var DV_ID = Request["DV_ID"];
var NgayPhatHanh = Request["NgayPhatHanh"];
var NgayNhan = Request["NgayNhan"];
var NguoiNhan = Request["NguoiNhan"];
var NgayTao = Request["NgayTao"];
var NgayCapNhat = Request["NgayCapNhat"];
var NguoiTao = Request["NguoiTao"];
var NguoiCapNhat = Request["NguoiCapNhat"];
var DaDung = Request["DaDung"];
var EmailTitle = Request["EmailTitle"];
var EmailBody = Request["EmailBody"];
var _q = Request["q"];
#endregion
var ListRow = new List<jgridRow>();
switch (subAct)
{
case "get":
#region get
var pagerGet = TheKhuyenMaiDal.pagerAll("a.TKM_" + jgrsidx + " " + jgrsord, _q,
Convert.ToInt32(jgRows), KM_ID, DVTC_ID, DV_ID, TinhTrang, DaDung);
foreach (var item in pagerGet.List)
{
ListRow.Add(new jgridRow(item.ID.ToString(), new string[] {
item.ID.ToString()
, item.DVTC_Ten
, item.KM_Ten
, item.Ma
, Lib.TienVietNam(item.Gia)
, Lib.TienVietNam(item.GiaNY)
, item.KH_Ten
, item.DV_Ten
, item.NgayPhatHanh== DateTime.MinValue ? "" : item.NgayPhatHanh.ToString("dd/MM/yyyy")
, item.HanSuDung== DateTime.MinValue ? "" : item.HanSuDung.ToString("dd/MM/yyyy")
, item.HanDoiThe== DateTime.MinValue ? "" : item.HanDoiThe.ToString("dd/MM/yyyy")
, item.TinhTrang.ToString()
, item.DaDung.ToString()
, string.Format("{0:dd/MM/yy}",item.NgayCapNhat
)
}));
}
jgrid gridSPAdm = new jgrid(string.IsNullOrEmpty(jgrpage) ? "1" : jgrpage
, pagerGet.TotalPages.ToString()
, pagerGet.Total.ToString()
, ListRow);
sb.Append(JavaScriptConvert.SerializeObject(gridSPAdm));
break;
#endregion
case "save":
#region chỉnh sửa
if (Security.IsAuthenticated())
{
var item = new TheKhuyenMai();
if (!string.IsNullOrEmpty(ID))
{
item = TheKhuyenMaiDal.SelectById(new Guid(ID));
}
if (!string.IsNullOrEmpty(DVTC_ID))
{
item.DVTC_ID = new Guid(DVTC_ID);
}
if (!string.IsNullOrEmpty(DV_ID))
{
item.DV_ID = new Guid(DV_ID);
}
item.Gia = Convert.ToDouble(Gia);
item.GiaNY = Convert.ToDouble(GiaNY);
if (!string.IsNullOrEmpty(HanDoiThe))
{
item.HanDoiThe = Convert.ToDateTime(HanDoiThe, new CultureInfo("vi-Vn"));
}
if (!string.IsNullOrEmpty(HanSuDung))
{
item.HanSuDung = Convert.ToDateTime(HanSuDung, new CultureInfo("vi-Vn"));
}
if (!string.IsNullOrEmpty(KH_ID))
{
item.KH_ID = new Guid(KH_ID);
}
if (!string.IsNullOrEmpty(KM_ID))
//.........这里部分代码省略.........
示例14: Render
protected override void Render(HtmlTextWriter writer)
{
StringBuilder sb = new StringBuilder();
ClientScriptManager cs = this.Page.ClientScript;
#region Tham số
string _ID = Request["ID"];
string _Ten = Request["Ten"];
string _DM_ID = Request["DM_ID"];
string _ThuTu = Request["ThuTu"];
string _Active = Request["Active"];
string _Hot = Request["Hot"];
string _Hot1 = Request["Hot1"];
string _Hot2 = Request["Hot2"];
string _Hot3 = Request["Hot3"];
Nhom ItemSave;
List<jgridRow> ListRow = new List<jgridRow>();
#endregion
switch (subAct)
{
case "get":
#region lấy dữ liệu cho grid
if (string.IsNullOrEmpty(jgrsidx)) jgrsidx = "BAO_ID";
if (string.IsNullOrEmpty(jgrsord)) jgrsord = "asc";
List<Nhom> List = NhomDal.SelectAll();
ListRow = new List<jgridRow>();
foreach (Nhom dm in List)
{
ListRow.Add(new jgridRow(dm.ID.ToString(), new string[] {
dm.ID.ToString()
, dm._DanhMuc.Ten
, dm.Ten
, dm.ThuTu.ToString()
, dm.Active.ToString()
, dm.Hot.ToString()
, dm.Hot1.ToString()
, dm.Hot2.ToString()
, dm.Hot3.ToString()
}));
}
jgrid grid = new jgrid(string.IsNullOrEmpty(jgrpage) ? "1" : jgrpage, List.Count.ToString(), List.Count.ToString(), ListRow);
sb.Append(JavaScriptConvert.SerializeObject(grid));
break;
#endregion
case "del":
#region xóa
if (!string.IsNullOrEmpty(_ID))
{
NhomDal.DeleteById(Convert.ToInt32(_ID));
}
break;
#endregion
case "edit":
#region chỉnh sửa
if (!string.IsNullOrEmpty(_ID))
{
sb.Append("(" + JavaScriptConvert.SerializeObject(NhomDal.SelectById(Convert.ToInt32(_ID))) + ")");
}
break;
#endregion
case "save":
#region lưu
ItemSave = new Nhom();
if (!string.IsNullOrEmpty(_ID))
{
ItemSave = NhomDal.SelectById(Convert.ToInt32(_ID));
}
else
{
ItemSave = new Nhom();
}
ItemSave.Ten = _Ten;
ItemSave.ThuTu = Convert.ToInt32(_ThuTu);
ItemSave.Active = Convert.ToBoolean(_Active);
ItemSave.Hot = Convert.ToBoolean(_Hot);
ItemSave.Hot1 = Convert.ToBoolean(_Hot1);
ItemSave.Hot2 = Convert.ToBoolean(_Hot2);
ItemSave.Hot3 = Convert.ToBoolean(_Hot3);
if (!string.IsNullOrEmpty(_DM_ID))
{
ItemSave.DM_ID = Convert.ToInt32(_DM_ID);
}
if (!string.IsNullOrEmpty(_ID))
{
ItemSave = NhomDal.Update(ItemSave);
}
else
{
ItemSave = NhomDal.Insert(ItemSave);
}
sb.Append("1");
break;
#endregion
case "getautoComplete":
#region Lấy danh sách danh mục
sb.Append(JavaScriptConvert.SerializeObject(NhomDal.SelectAll()));
break;
#endregion
case "getSubTin":
//.........这里部分代码省略.........
示例15: Render
protected override void Render(HtmlTextWriter writer)
{
StringBuilder sb = new StringBuilder();
ClientScriptManager cs = this.Page.ClientScript;
#region Tham số
string _ID = Request["ID"];
string _LangBased = Request["LangBased"];
string _LangBased_ID = Request["LangBased_ID"];
string _DM_ID = Request["DM_ID"];
string _Ten = Request["Ten"];
string _Ma = Request["Ma"];
string _Alias = Request["Alias"];
string _Lang = Request["Lang"];
string _XuatXu_ID = Request["XuatXu_ID"];
string _DonVi_ID = Request["DonVi_ID"];
string _SoLuong = Request["SoLuong"];
string _GNY = Request["GNY"];
string _GiaNhap = Request["GiaNhap"];
string _KeyWords = Request["KeyWords"];
string _Description = Request["Description"];
string _MoTa = Request["MoTa"];
string _Anh = Request["Anh"];
string _NoiDung = Request["NoiDung"];
string _Active = Request["Active"];
string _Publish = Request["Publish"];
string _Hot = Request["Hot"];
string _Hot1 = Request["Hot1"];
string _Hot2 = Request["Hot2"];
string _Hot3 = Request["Hot3"];
string _Hot4 = Request["Hot4"];
string _q = Request["q"];
HangHoa Item;
List<HangHoa> List = new List<HangHoa>();
List<jgridRow> ListRow = new List<jgridRow>();
#endregion
switch (subAct)
{
case "get":
#region lấy dữ liệu cho grid
Pager<HangHoa> PagerGet = HangHoaDal.pagerLangBased("HH_" + jgrsidx + " " + jgrsord, Convert.ToInt32(jgRows));
foreach (HangHoa item in PagerGet.List)
{
ListRow.Add(new jgridRow(item.ID.ToString(), new string[] {
item.ID.ToString()
, item.LangBased.ToString()
, item.Lang
, string.Format(@"<img src=""../up/i/{0}"" />",Lib.imgSize(item.Anh,"50x50"))
, item._DM_Ten
, item.Ma
, item.Ten
, item.GNY.ToString("###.###")
, string.Format("{0:dd/MM/yy}",item.NgayCapNhat)
}));
}
jgrid grid = new jgrid(string.IsNullOrEmpty(jgrpage) ? "1" : jgrpage
, List.Count.ToString()
, List.Count.ToString()
, ListRow);
sb.Append(JavaScriptConvert.SerializeObject(grid));
break;
#endregion
case "del":
#region xóa
if (!string.IsNullOrEmpty(_ID))
{
HangHoaDal.DeleteById(Convert.ToInt32(_ID));
}
break;
#endregion
case "edit":
#region chỉnh sửa
if (!string.IsNullOrEmpty(_ID))
{
sb.AppendFormat("({0})", JavaScriptConvert.SerializeObject(HangHoaDal.SelectByIdHoangDa(Convert.ToInt32(_ID))));
}
break;
#endregion
case "save":
#region lưu
if (!string.IsNullOrEmpty(_ID))
{
Item = HangHoaDal.SelectByIdHoangDa(Convert.ToInt32(_ID));
}
else
{
Item = new HangHoa();
}
Item.LangBased = Convert.ToBoolean(_LangBased);
if (!string.IsNullOrEmpty(_LangBased_ID))
{
Item.LangBased_ID = Convert.ToInt32(_LangBased_ID);
}
if (!string.IsNullOrEmpty(_DM_ID))
{
Item.DM_ID = Convert.ToInt32(_DM_ID);
}
Item.Ten = _Ten;
Item.Ma = _Ma;
Item.Alias = _Alias;
//.........这里部分代码省略.........