protected void btnFind_Click(object sender, EventArgs e) { condObj = new Ec_blocks(); if (txtBlockid.Value != "") condObj.Like(Ec_blocks.Attribute.Blockid, Convert.ToInt32(txtBlockid.Value)); if (txtTabid.Value != "") condObj.Like(Ec_blocks.Attribute.Tabid, Convert.ToInt32(txtTabid.Value)); if (txtBlocklabel.Value != "") condObj.Like(Ec_blocks.Attribute.Blocklabel, Convert.ToString(txtBlocklabel.Value)); if (txtSequence.Value != "") condObj.Like(Ec_blocks.Attribute.Sequence, Convert.ToInt32(txtSequence.Value)); if (txtShow_title.Value != "") condObj.Like(Ec_blocks.Attribute.Show_title, Convert.ToInt32(txtShow_title.Value)); if (txtVisible.Value != "") condObj.Like(Ec_blocks.Attribute.Visible, Convert.ToInt32(txtVisible.Value)); if (txtCreate_view.Value != "") condObj.Like(Ec_blocks.Attribute.Create_view, Convert.ToInt32(txtCreate_view.Value)); if (txtEdit_view.Value != "") condObj.Like(Ec_blocks.Attribute.Edit_view, Convert.ToInt32(txtEdit_view.Value)); if (txtDetail_view.Value != "") condObj.Like(Ec_blocks.Attribute.Detail_view, Convert.ToInt32(txtDetail_view.Value)); hidCondition.Value = condObj.ToJson(20); BindList(condObj, 1); }
//protected int i = 0; protected void Page_Load(object sender, EventArgs e) { string aa = Request["parenttab"]; Ec_blocks val = new Ec_blocks(); val.Tabid = Convert.ToInt32(Request["fld_module"]); val.OrderBy(Ec_blocks.Attribute.Sequence); list = BLLTable<Ec_blocks>.Factory(conn).Select(new Ec_blocks(), val); }
protected void aspPager_PageChanged(object sender, EventArgs e) { if (hidCondition.Value != "") { condObj = JsonServiceBase.FromJson<Ec_blocks>(hidCondition.Value); } BindList(condObj, aspPager.CurrentPageIndex); }
protected void aspPager_PageChanged(object sender, EventArgs e) { if (hidCondition.Value != "") { condObj = JsonServiceBase.FromJson <Ec_blocks>(hidCondition.Value); } BindList(condObj, aspPager.CurrentPageIndex); }
protected void Page_Load(object sender, EventArgs e) { title = valObj._ZhName + "��ϸ"; Page.Title = title; if (!IsPostBack) { try { if (!string.IsNullOrEmpty(Request["Blockid"])) { valObj = BLLTable<Ec_blocks>.Factory(conn).GetRowData(Ec_blocks.Attribute.Blockid, Request["Blockid"]); if(valObj==null) return ; txtBlockid.Text = Convert.ToString(valObj.Blockid);//Convert.ToInt32 txtTabid.Text = Convert.ToString(valObj.Tabid);//Convert.ToInt32 txtBlocklabel.Text = Convert.ToString(valObj.Blocklabel);//Convert.ToString txtSequence.Text = Convert.ToString(valObj.Sequence);//Convert.ToInt32 txtShow_title.Text = Convert.ToString(valObj.Show_title);//Convert.ToInt32 txtVisible.Text = Convert.ToString(valObj.Visible);//Convert.ToInt32 txtCreate_view.Text = Convert.ToString(valObj.Create_view);//Convert.ToInt32 txtEdit_view.Text = Convert.ToString(valObj.Edit_view);//Convert.ToInt32 txtDetail_view.Text = Convert.ToString(valObj.Detail_view);//Convert.ToInt32 } } catch (Exception ex) { litWarn.Text = ex.Message; } if (Request["ajax"] != null) { Response.Clear(); Response.Buffer = true; Response.Charset = "utf-8"; Response.ContentEncoding = System.Text.Encoding.GetEncoding("utf-8");//���������Ϊ�������� //Response.ContentType = "html/text"; this.EnableViewState = false; System.Globalization.CultureInfo myCItrad = new System.Globalization.CultureInfo("ZH-CN", true); System.IO.StringWriter oStringWriter = new System.IO.StringWriter(myCItrad); System.Web.UI.HtmlTextWriter oHtmlTextWriter = new System.Web.UI.HtmlTextWriter(oStringWriter); divC.RenderControl(oHtmlTextWriter); Response.Write(oStringWriter.ToString()); Response.End(); } } }
protected void btnSetPageSize_Click(object sender, EventArgs e) { aspPager.PageSize = int.Parse(txtPageSize.Value); if (hidCondition.Value != "") { condObj = JsonServiceBase.FromJson <Ec_blocks>(hidCondition.Value); } BindList(condObj, aspPager.CurrentPageIndex); }
//protected int i = 0; protected void Page_Load(object sender, EventArgs e) { string aa = Request["parenttab"]; Ec_blocks val = new Ec_blocks(); val.Tabid = Convert.ToInt32(Request["fld_module"]); val.OrderBy(Ec_blocks.Attribute.Sequence); list = BLLTable <Ec_blocks> .Factory(conn).Select(new Ec_blocks(), val); }
protected void btnSetPageSize_Click(object sender, EventArgs e) { aspPager.PageSize = int.Parse(txtPageSize.Value); if (hidCondition.Value != "") { condObj = JsonServiceBase.FromJson<Ec_blocks>(hidCondition.Value); } BindList(condObj, aspPager.CurrentPageIndex); }
protected void Page_Load(object sender, EventArgs e) { #region//默认隐藏的列 //hideTableColumnList = new List<AttributeItem>(); //hideTableColumnList.Add(Ec_blocks.Attribute.EXP1); //hideTableColumnList.Add(Ec_blocks.Attribute.EXP2); //hideTableColumnList.Add(Ec_blocks.Attribute.EXP3); //valObj.LoadAllAttributes(true);//暂时加此代码,以后框架更新将不需要 //valObj.Remove(hideTableColumnList); //hideFindColumnList = new List<AttributeItem>(); //hideFindColumnList.Add(Ec_blocks.Attribute.EXP1); //hideFindColumnList.Add(Ec_blocks.Attribute.EXP2); //hideFindColumnList.Add(Ec_blocks.Attribute.EXP3); #endregion condObj.OrderBy(Ec_blocks.Attribute.Blockid, Order.Desc); if (!IsPostBack) { btnFind.Text = LanguageService.GetLanguageString("btnFind", "查询"); aspPager.PageSize = 10; aspPager.CurrentPageIndex = 1; if (!string.IsNullOrEmpty(Request["ids"])) { Ec_blocks roleOld = new Ec_blocks(); roleOld.Where(Ec_blocks.Attribute.Blockid, Request["ids"].ToString()); listObj = BLLTable <Ec_blocks> .Factory(conn).Select(valObj, roleOld); for (int i = 0; i < listObj.Count; i++) { if (i > 0) { hidOld.Value += ","; hidInitIDS.Value += ","; } hidOld.Value += "{ID:'" + listObj[i].Blockid + "',Name:'" + listObj[i].Blockid + "'}";//这里的Name用于显示在列表中,请自行重定义。 hidInitIDS.Value += listObj[i].Blockid; } } try { listObj = BLLTable <Ec_blocks> .Factory(conn).SelectByPage(valObj, condObj, aspPager.PageSize, 1, ref recount); repList.DataSource = listObj; repList.DataBind(); aspPager.RecordCount = recount; } catch (Exception ex) { litWarn.Text = ex.Message; } } }
protected void Page_Load(object sender, EventArgs e) { //在列表里点击删除按钮,通过AJAX执行这里的后台代码,删除一条记录 if (Request["DelBlockid"] != null) { int re = BLLTable <Ec_blocks> .Factory(conn).Delete(Ec_blocks.Attribute.Blockid, Request["DelBlockid"]); if (re > 0) { Response.Write("1");//可以输出数字 大于0 表示操作成功,也可以直接输出 字符串,客户端将弹出此字符串信息作为提示 } else { Response.Write("删除失败!"); } } //在列表顶部点击删除按钮,通过AJAX执行这里的后台代码,删除多条记录 if (Request["DelKeyIDS"] != null) { Ec_blocks cond = new Ec_blocks(); cond.In(Ec_blocks.Attribute.Blockid, Request["DelKeyIDS"]); int re = BLLTable <Ec_blocks> .Factory(conn).Delete(cond); if (re > 0) { Response.Write("1");//可以输出数字 大于0 表示操作成功,也可以直接输出 字符串,客户端将弹出此字符串信息作为提示 } else { Response.Write("删除失败!"); } } //在用户详细信息查看编辑页面,点保存时,通过AJAX执行这里的后台代码,实现部门字段的更新 if (Request["saveInfo"] != null) { Ec_blocks val = new Ec_blocks(); val.Blockid = int.Parse(Request["FieldKeyID"]); List <AttributeItem> lstCol = val.af_AttributeItemList; for (int i = 0; i < lstCol.Count; i++) { if (!string.IsNullOrEmpty(Request["txt" + lstCol[i].FieldName])) { val.SetValue(lstCol[i].FieldName, Request["txt" + lstCol[i].FieldName]); } } BLLTable <Ec_blocks> .Factory(conn).Update(val, Ec_blocks.Attribute.Blockid); Response.Write("修改用户信息成功"); } Response.End(); }
protected void Page_Load(object sender, EventArgs e) { //���б�����ɾ����ť��ͨ��AJAXִ������ĺ�̨���룬ɾ��һ����¼ if (Request["DelBlockid"] != null) { int re = BLLTable<Ec_blocks>.Factory(conn).Delete(Ec_blocks.Attribute.Blockid, Request["DelBlockid"]); if (re > 0) { Response.Write("1");//����������� ����0 ��ʾ�����ɹ���Ҳ����ֱ����� �ַ������ͻ��˽��������ַ�����Ϣ��Ϊ��ʾ } else { Response.Write("ɾ��ʧ�ܣ�"); } } //���б�������ɾ����ť��ͨ��AJAXִ������ĺ�̨���룬ɾ��������¼ if (Request["DelKeyIDS"] != null) { Ec_blocks cond = new Ec_blocks(); cond.In(Ec_blocks.Attribute.Blockid, Request["DelKeyIDS"]); int re = BLLTable<Ec_blocks>.Factory(conn).Delete(cond); if (re > 0) { Response.Write("1");//����������� ����0 ��ʾ�����ɹ���Ҳ����ֱ����� �ַ������ͻ��˽��������ַ�����Ϣ��Ϊ��ʾ } else { Response.Write("ɾ��ʧ�ܣ�"); } } //���û���ϸ��Ϣ�鿴�༭ҳ�棬�㱣��ʱ��ͨ��AJAXִ������ĺ�̨���룬ʵ�ֲ����ֶεĸ��� if (Request["saveInfo"] != null) { Ec_blocks val = new Ec_blocks(); val.Blockid = int.Parse(Request["FieldKeyID"]); List<AttributeItem> lstCol = val.af_AttributeItemList; for (int i = 0; i < lstCol.Count; i++) { if (!string.IsNullOrEmpty(Request["txt" + lstCol[i].FieldName])) { val.SetValue(lstCol[i].FieldName,Request["txt" + lstCol[i].FieldName]); } } BLLTable<Ec_blocks>.Factory(conn).Update(val, Ec_blocks.Attribute.Blockid); Response.Write("���û���Ϣ�ɹ�"); } Response.End(); }
protected void aspPager_PageChanged(object sender, EventArgs e) { try { recount = aspPager.RecordCount; if (hidCondition.Value != "") { condObj = JsonServiceBase.FromJson<Ec_blocks>(hidCondition.Value); } List<Ec_blocks> listVal = BLLTable<Ec_blocks>.Factory(conn).SelectByPage(valObj, condObj, aspPager.PageSize, aspPager.CurrentPageIndex, ref recount); repList.DataSource = listVal; repList.DataBind(); } catch (Exception ex) { litWarn.Text = ex.Message; } }
private void BindList(Ec_blocks condObj, int curPage) { if (condObj.af_PageByAttributeItem == null)//如果不存在用户定义的分页排序属性,则用主键属性排序 { condObj.af_PageBy(Ec_blocks.Attribute.Blockid, Order.Desc); } #region//数据权限条件 #endregion //condObj.PID = decimal.Parse(pid); listObj = BLLTable <Ec_blocks> .Factory(conn).SelectByPage(valObj, condObj, aspPager.PageSize, curPage, ref recount); repList.DataSource = listObj; repList.DataBind(); aspPager.RecordCount = recount; }
protected void aspPager_PageChanged(object sender, EventArgs e) { try { if (hidCondition.Value != "") { condObj = JsonServiceBase.FromJson <Ec_blocks>(hidCondition.Value); } listObj = BLLTable <Ec_blocks> .Factory(conn).SelectByPage(valObj, condObj, aspPager.PageSize, aspPager.CurrentPageIndex, ref recount); repCus.DataSource = listObj; repCus.DataBind(); } catch (Exception ex) { litWarn.Text = ex.Message; } }
protected void btnFind_Click(object sender, EventArgs e) { condObj = new Ec_blocks(); if(txtBlockid.Value !="" ) condObj.Like_OR(Ec_blocks.Attribute.Blockid, Convert.ToInt32(txtBlockid.Value)); if(txtTabid.Value !="" ) condObj.Like_OR(Ec_blocks.Attribute.Tabid, Convert.ToInt32(txtTabid.Value)); if(txtBlocklabel.Value !="" ) condObj.Like_OR(Ec_blocks.Attribute.Blocklabel, Convert.ToString(txtBlocklabel.Value)); if(txtSequence.Value !="" ) condObj.Like_OR(Ec_blocks.Attribute.Sequence, Convert.ToInt32(txtSequence.Value)); if(txtShow_title.Value !="" ) condObj.Like_OR(Ec_blocks.Attribute.Show_title, Convert.ToInt32(txtShow_title.Value)); if(txtVisible.Value !="" ) condObj.Like_OR(Ec_blocks.Attribute.Visible, Convert.ToInt32(txtVisible.Value)); if(txtCreate_view.Value !="" ) condObj.Like_OR(Ec_blocks.Attribute.Create_view, Convert.ToInt32(txtCreate_view.Value)); if(txtEdit_view.Value !="" ) condObj.Like_OR(Ec_blocks.Attribute.Edit_view, Convert.ToInt32(txtEdit_view.Value)); if(txtDetail_view.Value !="" ) condObj.Like_OR(Ec_blocks.Attribute.Detail_view, Convert.ToInt32(txtDetail_view.Value)); try { hidCondition.Value = condObj.ToJson(20); listObj = BLLTable<Ec_blocks>.Factory(conn).SelectByPage(valObj, condObj, aspPager.PageSize, 1, ref recount); repList.DataSource = listObj; repList.DataBind(); } catch (Exception ex) { litWarn.Text = ex.Message; } }
protected void customblocklist() { Ec_blocks val = new Ec_blocks(); val.Tabid = Convert.ToInt32(Request["fld_module"]); val.OrderBy(Ec_blocks.Attribute.Sequence); List<Ec_blocks> list = BLLTable<Ec_blocks>.Factory(conn).Select(new Ec_blocks(), val); mainvalue.Append("<table class=\"crm-table\" width=\"100%\" border=\"0\" cellpadding=\"3\" cellspacing=\"1\"><tbody><tr height=\"28px\" class=\"windLayerHead\"><td width=\"5%\">#</td><td width=\"20%\">显示区域</td><td width=\"20%\">显示顺序</td><td width=\"20%\">工具</td></tr>"); int i = 0; foreach (Ec_blocks ec in list) { i = i + 1; mainvalue.Append("<tr>"); mainvalue.Append(string.Format("<td nowrap=\"\">{0} </td>", i)); mainvalue.Append(string.Format("<td nowrap=\"\">{0} </td><td nowrap=\"\">{1} </td></td><td nowrap=\"\">", ec.Blocklabel, ec.Sequence)); mainvalue.Append(string.Format("<i class=\"icon-edit pure-icon-bu crm-bu-style\" style=\"width:50px;height:50px;cursor:pointer;font-size:14px;\" onclick=\"getCreateCustomBlockForm('{0}','{1}','{2}','{3}','{4}')\"></i>", ec.Blockid, ec.Blockid, ec.Tabid, ec.Blocklabel, ec.Sequence));//(customModule,blockid,tabid,label,order) mainvalue.Append(string.Format("<i class=\"icon-trash pure-icon-bu crm-bu-style\" style=\"width:50px;height:50px;cursor:pointer;font-size:14px;\" onclick=\"deleteCustomBlock({0},'{0}', '', '');\"></i>", ec.Blockid)); mainvalue.Append(" </td></tr>"); } mainvalue.Append("</tbody></table>"); }
protected void customblocklist() { Ec_blocks val = new Ec_blocks(); val.Tabid = Convert.ToInt32(Request["fld_module"]); val.OrderBy(Ec_blocks.Attribute.Sequence); List <Ec_blocks> list = BLLTable <Ec_blocks> .Factory(conn).Select(new Ec_blocks(), val); mainvalue.Append("<table class=\"crm-table\" width=\"100%\" border=\"0\" cellpadding=\"3\" cellspacing=\"1\"><tbody><tr height=\"28px\" class=\"windLayerHead\"><td width=\"5%\">#</td><td width=\"20%\">显示区域</td><td width=\"20%\">显示顺序</td><td width=\"20%\">工具</td></tr>"); int i = 0; foreach (Ec_blocks ec in list) { i = i + 1; mainvalue.Append("<tr>"); mainvalue.Append(string.Format("<td nowrap=\"\">{0} </td>", i)); mainvalue.Append(string.Format("<td nowrap=\"\">{0} </td><td nowrap=\"\">{1} </td></td><td nowrap=\"\">", ec.Blocklabel, ec.Sequence)); mainvalue.Append(string.Format("<i class=\"icon-edit pure-icon-bu crm-bu-style\" style=\"width:50px;height:50px;cursor:pointer;font-size:14px;\" onclick=\"getCreateCustomBlockForm('{0}','{1}','{2}','{3}','{4}')\"></i>", ec.Blockid, ec.Blockid, ec.Tabid, ec.Blocklabel, ec.Sequence));//(customModule,blockid,tabid,label,order) mainvalue.Append(string.Format("<i class=\"icon-trash pure-icon-bu crm-bu-style\" style=\"width:50px;height:50px;cursor:pointer;font-size:14px;\" onclick=\"deleteCustomBlock({0},'{0}', '', '');\"></i>", ec.Blockid)); mainvalue.Append(" </td></tr>"); } mainvalue.Append("</tbody></table>"); }
protected void Page_Load(object sender, EventArgs e) { title = valObj._ZhName + "详细"; Page.Title = title; if (!IsPostBack) { try { if (!string.IsNullOrEmpty(Request["Blockid"])) { valObj = BLLTable <Ec_blocks> .Factory(conn).GetRowData(Ec_blocks.Attribute.Blockid, Request["Blockid"]); if (valObj == null) { return; } txtBlockid.Text = Convert.ToString(valObj.Blockid);//Convert.ToInt32 txtTabid.Text = Convert.ToString(valObj.Tabid);//Convert.ToInt32 txtBlocklabel.Text = Convert.ToString(valObj.Blocklabel);//Convert.ToString txtSequence.Text = Convert.ToString(valObj.Sequence);//Convert.ToInt32 txtShow_title.Text = Convert.ToString(valObj.Show_title);//Convert.ToInt32 txtVisible.Text = Convert.ToString(valObj.Visible);//Convert.ToInt32 txtCreate_view.Text = Convert.ToString(valObj.Create_view);//Convert.ToInt32 txtEdit_view.Text = Convert.ToString(valObj.Edit_view);//Convert.ToInt32 txtDetail_view.Text = Convert.ToString(valObj.Detail_view);//Convert.ToInt32 } } catch (Exception ex) { litWarn.Text = ex.Message; } if (Request["ajax"] != null) { Response.Clear(); Response.Buffer = true; Response.Charset = "utf-8"; Response.ContentEncoding = System.Text.Encoding.GetEncoding("utf-8");//设置输出流为简体中文 //Response.ContentType = "html/text"; this.EnableViewState = false; System.Globalization.CultureInfo myCItrad = new System.Globalization.CultureInfo("ZH-CN", true); System.IO.StringWriter oStringWriter = new System.IO.StringWriter(myCItrad); System.Web.UI.HtmlTextWriter oHtmlTextWriter = new System.Web.UI.HtmlTextWriter(oStringWriter); divC.RenderControl(oHtmlTextWriter); Response.Write(oStringWriter.ToString()); Response.End(); } } }
protected void btnOK_Click(object sender, EventArgs e) { try { Ec_blocks valObj = new Ec_blocks(); if (txtBlockid.Value != "") { valObj.Blockid = Convert.ToInt32(txtBlockid.Value); } if (txtTabid.Value != "") { valObj.Tabid = Convert.ToInt32(txtTabid.Value); } if (txtBlocklabel.Value != "") { valObj.Blocklabel = Convert.ToString(txtBlocklabel.Value); } if (txtSequence.Value != "") { valObj.Sequence = Convert.ToInt32(txtSequence.Value); } if (txtShow_title.Value != "") { valObj.Show_title = Convert.ToInt32(txtShow_title.Value); } //if ( Request.Form["IsVisible"]!="") // valObj.Visible =Convert.ToInt32( Request.Form["IsVisible"]); //if (Request.Form["Create_view"]!= "") // valObj.Create_view = Convert.ToInt32(Request.Form["Create_view"]); if (txtEdit_view.Value != "") { valObj.Edit_view = Convert.ToInt32(txtEdit_view.Value); } if (txtDetail_view.Value != "") { valObj.Detail_view = Convert.ToInt32(txtDetail_view.Value); } if (keyid != "") { valObj.Blockid = Convert.ToInt32(keyid); count = BLLTable <Ec_blocks> .Factory(conn).Update(valObj, Ec_blocks.Attribute.Blockid); } else { count = BLLTable <Ec_blocks> .Factory(conn).Insert(valObj, Ec_blocks.Attribute.Blockid); keyid = valObj.Blockid.ToString(); } if (count > 0) { StringBuilder sbData = new StringBuilder("{valObj:''"); List <AttributeItem> lstCol = valObj.af_AttributeItemList; for (int i = 0; i < lstCol.Count; i++) { object val = valObj.GetValue(lstCol[i]); if (val != null) { sbData.Append(",").Append(lstCol[i].FieldName).Append(":'").Append(val.ToString()).Append("'"); } } sbData.Append("}"); if (ViewState["sbData"] == null) { ViewState["sbData"] = sbData.ToString(); } else { ViewState["sbData"] += "," + sbData.ToString(); } Button btn = (Button)sender; if (btn.ID.IndexOf("btnOK") != -1) { if (ViewState["sbData"] == null) { string dataStr = "[" + ViewState["sbData"].ToString() + "]"; ScriptManager.RegisterStartupScript(Page, this.GetType(), "goto", "window.returnValue=\"" + dataStr + "\";window.close();", true); } else { ScriptManager.RegisterStartupScript(Page, this.GetType(), "goto", "window.returnValue=\"re\";window.close();", true); } } else { txtBlockid.Value = ""; txtTabid.Value = ""; txtBlocklabel.Value = ""; txtSequence.Value = ""; txtShow_title.Value = ""; //txtVisible.Value =""; //IsCreate_view.Checked = true; //IsVisible.Checked = true; //txtCreate_view.Value =""; txtEdit_view.Value = ""; txtDetail_view.Value = ""; } } } catch (Exception ex) { litWarn.Text = ex.Message; } }
protected void Page_Load(object sender, EventArgs e) { title = valObj._ZhName + "�༭"; Page.Title = title; if (!string.IsNullOrEmpty(Request["Blockid"])) { keyid = Request["Blockid"]; } if (!string.IsNullOrEmpty(Request["KeyID"])) { keyid = Request["KeyID"]; } if (!IsPostBack) { this.txtBlockid.Disabled = true; this.txtBlockid.Value = "0"; this.txtBlockid.Attributes["class"] = "dis"; try { if (keyid != "") { valObj = BLLTable<Ec_blocks>.Factory(conn).GetRowData(Ec_blocks.Attribute.Blockid, keyid); if(valObj==null) return ; txtBlockid.Value = Convert.ToString(valObj.Blockid);//Convert.ToInt32 txtTabid.Value = Convert.ToString(valObj.Tabid);//Convert.ToInt32 txtBlocklabel.Value = Convert.ToString(valObj.Blocklabel);//Convert.ToString txtSequence.Value = Convert.ToString(valObj.Sequence);//Convert.ToInt32 txtShow_title.Value = Convert.ToString(valObj.Show_title);//Convert.ToInt32 if (valObj.Visible == 1) IsVisible.Checked = true; else NoVisible.Checked = true; if (valObj.Create_view == 1) IsCreate_view.Checked = true; else NoCreate_view.Checked = true; txtEdit_view.Value = Convert.ToString(valObj.Edit_view);//Convert.ToInt32 txtDetail_view.Value = Convert.ToString(valObj.Detail_view);//Convert.ToInt32 } } catch (Exception ex) { litWarn.Text = ex.Message; } } }
protected void btnOK_Click(object sender, EventArgs e) { try { Ec_blocks valObj = new Ec_blocks(); if(txtBlockid.Value !="" ) valObj.Blockid = Convert.ToInt32(txtBlockid.Value); if(txtTabid.Value !="" ) valObj.Tabid = Convert.ToInt32(txtTabid.Value); if(txtBlocklabel.Value !="" ) valObj.Blocklabel = Convert.ToString(txtBlocklabel.Value); if(txtSequence.Value !="" ) valObj.Sequence = Convert.ToInt32(txtSequence.Value); if(txtShow_title.Value !="" ) valObj.Show_title = Convert.ToInt32(txtShow_title.Value); //if ( Request.Form["IsVisible"]!="") // valObj.Visible =Convert.ToInt32( Request.Form["IsVisible"]); //if (Request.Form["Create_view"]!= "") // valObj.Create_view = Convert.ToInt32(Request.Form["Create_view"]); if(txtEdit_view.Value !="" ) valObj.Edit_view = Convert.ToInt32(txtEdit_view.Value); if(txtDetail_view.Value !="" ) valObj.Detail_view = Convert.ToInt32(txtDetail_view.Value); if (keyid != "") { valObj.Blockid = Convert.ToInt32(keyid); count = BLLTable<Ec_blocks>.Factory(conn).Update(valObj, Ec_blocks.Attribute.Blockid); } else { count = BLLTable<Ec_blocks>.Factory(conn).Insert(valObj, Ec_blocks.Attribute.Blockid); keyid = valObj.Blockid.ToString(); } if (count > 0) { StringBuilder sbData = new StringBuilder("{valObj:''"); List<AttributeItem> lstCol = valObj.af_AttributeItemList; for (int i = 0; i < lstCol.Count; i++) { object val = valObj.GetValue(lstCol[i]); if (val != null) { sbData.Append(",").Append(lstCol[i].FieldName).Append(":'").Append(val.ToString()).Append("'"); } } sbData.Append("}"); if (ViewState["sbData"] == null) { ViewState["sbData"] = sbData.ToString(); } else { ViewState["sbData"] += ","+sbData.ToString(); } Button btn = (Button)sender; if (btn.ID.IndexOf("btnOK")!=-1) { if (ViewState["sbData"] == null) { string dataStr = "[" + ViewState["sbData"] .ToString()+ "]"; ScriptManager.RegisterStartupScript(Page, this.GetType(), "goto", "window.returnValue=\"" + dataStr + "\";window.close();", true); } else { ScriptManager.RegisterStartupScript(Page, this.GetType(), "goto", "window.returnValue=\"re\";window.close();", true); } } else { txtBlockid.Value =""; txtTabid.Value =""; txtBlocklabel.Value =""; txtSequence.Value =""; txtShow_title.Value =""; //txtVisible.Value =""; //IsCreate_view.Checked = true; //IsVisible.Checked = true; //txtCreate_view.Value =""; txtEdit_view.Value =""; txtDetail_view.Value =""; } } } catch (Exception ex) { litWarn.Text = ex.Message; } }
private void BindList(Ec_blocks condObj, int curPage) { if (condObj.af_PageByAttributeItem == null)//����������û�����ķ�ҳ�������ԣ����������������� condObj.af_PageBy(Ec_blocks.Attribute.Blockid, Order.Desc); #region//����Ȩ������ #endregion //condObj.PID = decimal.Parse(pid); listObj = BLLTable<Ec_blocks>.Factory(conn).SelectByPage(valObj, condObj, aspPager.PageSize, curPage, ref recount); repList.DataSource = listObj; repList.DataBind(); aspPager.RecordCount = recount; }
protected void Page_Load(object sender, EventArgs e) { #region//Ĭ�����ص��� //hideTableColumnList = new List<AttributeItem>(); //hideTableColumnList.Add(Ec_blocks.Attribute.EXP1); //hideTableColumnList.Add(Ec_blocks.Attribute.EXP2); //hideTableColumnList.Add(Ec_blocks.Attribute.EXP3); //valObj.LoadAllAttributes(true);//��ʱ�Ӵ˴��룬�Ժ��ܸ��½�����Ҫ //valObj.Remove(hideTableColumnList); //hideFindColumnList = new List<AttributeItem>(); //hideFindColumnList.Add(Ec_blocks.Attribute.EXP1); //hideFindColumnList.Add(Ec_blocks.Attribute.EXP2); //hideFindColumnList.Add(Ec_blocks.Attribute.EXP3); #endregion condObj.OrderBy(Ec_blocks.Attribute.Blockid, Order.Desc); if (!IsPostBack) { btnFind.Text = LanguageService.GetLanguageString("btnFind", "��ѯ"); aspPager.PageSize = 10; aspPager.CurrentPageIndex = 1; if (!string.IsNullOrEmpty(Request["ids"])) { Ec_blocks roleOld = new Ec_blocks(); roleOld.Where(Ec_blocks.Attribute.Blockid, Request["ids"].ToString()); listObj = BLLTable<Ec_blocks>.Factory(conn).Select(valObj, roleOld); for (int i = 0; i < listObj.Count; i++) { if (i > 0) { hidOld.Value += ","; hidInitIDS.Value += ","; } hidOld.Value += "{ID:'" + listObj[i].Blockid + "',Name:'" + listObj[i].Blockid + "'}";//�����Name������ʾ���б��У��������ض��塣 hidInitIDS.Value += listObj[i].Blockid; } } try { listObj = BLLTable<Ec_blocks>.Factory(conn).SelectByPage(valObj, condObj, aspPager.PageSize, 1, ref recount); repList.DataSource = listObj; repList.DataBind(); aspPager.RecordCount = recount; } catch (Exception ex) { litWarn.Text = ex.Message; } } }
protected void btnFind_Click(object sender, EventArgs e) { condObj = new Ec_blocks(); if (txtBlockid.Value != "") { condObj.Like_OR(Ec_blocks.Attribute.Blockid, Convert.ToInt32(txtBlockid.Value)); } if (txtTabid.Value != "") { condObj.Like_OR(Ec_blocks.Attribute.Tabid, Convert.ToInt32(txtTabid.Value)); } if (txtBlocklabel.Value != "") { condObj.Like_OR(Ec_blocks.Attribute.Blocklabel, Convert.ToString(txtBlocklabel.Value)); } if (txtSequence.Value != "") { condObj.Like_OR(Ec_blocks.Attribute.Sequence, Convert.ToInt32(txtSequence.Value)); } if (txtShow_title.Value != "") { condObj.Like_OR(Ec_blocks.Attribute.Show_title, Convert.ToInt32(txtShow_title.Value)); } if (txtVisible.Value != "") { condObj.Like_OR(Ec_blocks.Attribute.Visible, Convert.ToInt32(txtVisible.Value)); } if (txtCreate_view.Value != "") { condObj.Like_OR(Ec_blocks.Attribute.Create_view, Convert.ToInt32(txtCreate_view.Value)); } if (txtEdit_view.Value != "") { condObj.Like_OR(Ec_blocks.Attribute.Edit_view, Convert.ToInt32(txtEdit_view.Value)); } if (txtDetail_view.Value != "") { condObj.Like_OR(Ec_blocks.Attribute.Detail_view, Convert.ToInt32(txtDetail_view.Value)); } try { hidCondition.Value = condObj.ToJson(20); listObj = BLLTable <Ec_blocks> .Factory(conn).SelectByPage(valObj, condObj, aspPager.PageSize, 1, ref recount); repList.DataSource = listObj; repList.DataBind(); } catch (Exception ex) { litWarn.Text = ex.Message; } }
protected void btnFind_Click(object sender, EventArgs e) { condObj = new Ec_blocks(); if (txtBlockid.Value != "") { condObj.Like(Ec_blocks.Attribute.Blockid, Convert.ToInt32(txtBlockid.Value)); } if (txtTabid.Value != "") { condObj.Like(Ec_blocks.Attribute.Tabid, Convert.ToInt32(txtTabid.Value)); } if (txtBlocklabel.Value != "") { condObj.Like(Ec_blocks.Attribute.Blocklabel, Convert.ToString(txtBlocklabel.Value)); } if (txtSequence.Value != "") { condObj.Like(Ec_blocks.Attribute.Sequence, Convert.ToInt32(txtSequence.Value)); } if (txtShow_title.Value != "") { condObj.Like(Ec_blocks.Attribute.Show_title, Convert.ToInt32(txtShow_title.Value)); } if (txtVisible.Value != "") { condObj.Like(Ec_blocks.Attribute.Visible, Convert.ToInt32(txtVisible.Value)); } if (txtCreate_view.Value != "") { condObj.Like(Ec_blocks.Attribute.Create_view, Convert.ToInt32(txtCreate_view.Value)); } if (txtEdit_view.Value != "") { condObj.Like(Ec_blocks.Attribute.Edit_view, Convert.ToInt32(txtEdit_view.Value)); } if (txtDetail_view.Value != "") { condObj.Like(Ec_blocks.Attribute.Detail_view, Convert.ToInt32(txtDetail_view.Value)); } hidCondition.Value = condObj.ToJson(20); BindList(condObj, 1); }
protected void Page_Load(object sender, EventArgs e) { title = valObj._ZhName + "±à¼"; Page.Title = title; if (!string.IsNullOrEmpty(Request["Blockid"])) { keyid = Request["Blockid"]; } if (!string.IsNullOrEmpty(Request["KeyID"])) { keyid = Request["KeyID"]; } if (!IsPostBack) { this.txtBlockid.Disabled = true; this.txtBlockid.Value = "0"; this.txtBlockid.Attributes["class"] = "dis"; try { if (keyid != "") { valObj = BLLTable <Ec_blocks> .Factory(conn).GetRowData(Ec_blocks.Attribute.Blockid, keyid); if (valObj == null) { return; } txtBlockid.Value = Convert.ToString(valObj.Blockid); //Convert.ToInt32 txtTabid.Value = Convert.ToString(valObj.Tabid); //Convert.ToInt32 txtBlocklabel.Value = Convert.ToString(valObj.Blocklabel); //Convert.ToString txtSequence.Value = Convert.ToString(valObj.Sequence); //Convert.ToInt32 txtShow_title.Value = Convert.ToString(valObj.Show_title); //Convert.ToInt32 if (valObj.Visible == 1) { IsVisible.Checked = true; } else { NoVisible.Checked = true; } if (valObj.Create_view == 1) { IsCreate_view.Checked = true; } else { NoCreate_view.Checked = true; } txtEdit_view.Value = Convert.ToString(valObj.Edit_view); //Convert.ToInt32 txtDetail_view.Value = Convert.ToString(valObj.Detail_view); //Convert.ToInt32 } } catch (Exception ex) { litWarn.Text = ex.Message; } } }