protected void btnFind_Click(object sender, EventArgs e) { condObj = new Ec_tab(); if(txtTabid.Value !="" ) condObj.Like(Ec_tab.Attribute.Tabid, Convert.ToInt32(txtTabid.Value)); if(txtName.Value !="" ) condObj.Like(Ec_tab.Attribute.Name, Convert.ToString(txtName.Value)); if(txtPresence.Value !="" ) condObj.Like(Ec_tab.Attribute.Presence, Convert.ToInt32(txtPresence.Value)); if(txtTabsequence.Value !="" ) condObj.Like(Ec_tab.Attribute.Tabsequence, Convert.ToInt32(txtTabsequence.Value)); if(txtTablabel.Value !="" ) condObj.Like(Ec_tab.Attribute.Tablabel, Convert.ToString(txtTablabel.Value)); if(txtModifiedby.Value !="" ) condObj.Like(Ec_tab.Attribute.Modifiedby, Convert.ToInt32(txtModifiedby.Value)); if(txtModifiedtime.Value !="" ) condObj.Like(Ec_tab.Attribute.Modifiedtime, Convert.ToInt32(txtModifiedtime.Value)); if(txtCustomized.Value !="" ) condObj.Like(Ec_tab.Attribute.Customized, Convert.ToInt32(txtCustomized.Value)); if(txtReportable.Value !="" ) condObj.Like(Ec_tab.Attribute.Reportable, Convert.ToInt32(txtReportable.Value)); hidCondition.Value = condObj.ToJson(20); BindList(condObj, 1); }
protected void aspPager_PageChanged(object sender, EventArgs e) { if (hidCondition.Value != "") { condObj = JsonServiceBase.FromJson<Ec_tab>(hidCondition.Value); } BindList(condObj, aspPager.CurrentPageIndex); }
protected void aspPager_PageChanged(object sender, EventArgs e) { if (hidCondition.Value != "") { condObj = JsonServiceBase.FromJson <Ec_tab>(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["Tabid"])) { valObj = BLLTable<Ec_tab>.Factory(conn).GetRowData(Ec_tab.Attribute.Tabid, Request["Tabid"]); if(valObj==null) return ; txtTabid.Text = Convert.ToString(valObj.Tabid);//Convert.ToInt32 txtName.Text = Convert.ToString(valObj.Name);//Convert.ToString txtPresence.Text = Convert.ToString(valObj.Presence);//Convert.ToInt32 txtTabsequence.Text = Convert.ToString(valObj.Tabsequence);//Convert.ToInt32 txtTablabel.Text = Convert.ToString(valObj.Tablabel);//Convert.ToString txtModifiedby.Text = Convert.ToString(valObj.Modifiedby);//Convert.ToInt32 txtModifiedtime.Text = Convert.ToString(valObj.Modifiedtime);//Convert.ToInt32 txtCustomized.Text = Convert.ToString(valObj.Customized);//Convert.ToInt32 txtReportable.Text = Convert.ToString(valObj.Reportable);//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_tab>(hidCondition.Value); } BindList(condObj, aspPager.CurrentPageIndex); }
protected void btnSetPageSize_Click(object sender, EventArgs e) { aspPager.PageSize = int.Parse(txtPageSize.Value); if (hidCondition.Value != "") { condObj = JsonServiceBase.FromJson <Ec_tab>(hidCondition.Value); } BindList(condObj, aspPager.CurrentPageIndex); }
protected void Page_Load(object sender, EventArgs e) { title = valObj._ZhName + "±à¼"; Page.Title = title; if (!string.IsNullOrEmpty(Request["Tabid"])) { keyid = Request["Tabid"]; } if (!string.IsNullOrEmpty(Request["KeyID"])) { keyid = Request["KeyID"]; } if (!IsPostBack) { this.txtTabid.Disabled = true; this.txtTabid.Value = "0"; this.txtTabid.Attributes["class"] = "dis"; try { if (keyid != "") { valObj = BLLTable <Ec_tab> .Factory(conn).GetRowData(Ec_tab.Attribute.Tabid, keyid); if (valObj == null) { return; } txtTabid.Value = Convert.ToString(valObj.Tabid); //Convert.ToInt32 txtName.Value = Convert.ToString(valObj.Name); //Convert.ToString txtPresence.Value = Convert.ToString(valObj.Presence); //Convert.ToInt32 txtTabsequence.Value = Convert.ToString(valObj.Tabsequence); //Convert.ToInt32 txtTablabel.Value = Convert.ToString(valObj.Tablabel); //Convert.ToString txtModifiedby.Value = Convert.ToString(valObj.Modifiedby); //Convert.ToInt32 txtModifiedtime.Value = Convert.ToString(valObj.Modifiedtime); //Convert.ToInt32 txtCustomized.Value = Convert.ToString(valObj.Customized); //Convert.ToInt32 txtReportable.Value = Convert.ToString(valObj.Reportable); //Convert.ToInt32 } } catch (Exception ex) { litWarn.Text = ex.Message; } } }
protected void Page_Load(object sender, EventArgs e) { //在列表里点击删除按钮,通过AJAX执行这里的后台代码,删除一条记录 if (Request["DelTabid"] != null) { int re = BLLTable <Ec_tab> .Factory(conn).Delete(Ec_tab.Attribute.Tabid, Request["DelTabid"]); if (re > 0) { Response.Write("1");//可以输出数字 大于0 表示操作成功,也可以直接输出 字符串,客户端将弹出此字符串信息作为提示 } else { Response.Write("删除失败!"); } } //在列表顶部点击删除按钮,通过AJAX执行这里的后台代码,删除多条记录 if (Request["DelKeyIDS"] != null) { Ec_tab cond = new Ec_tab(); cond.In(Ec_tab.Attribute.Tabid, Request["DelKeyIDS"]); int re = BLLTable <Ec_tab> .Factory(conn).Delete(cond); if (re > 0) { Response.Write("1");//可以输出数字 大于0 表示操作成功,也可以直接输出 字符串,客户端将弹出此字符串信息作为提示 } else { Response.Write("删除失败!"); } } //在用户详细信息查看编辑页面,点保存时,通过AJAX执行这里的后台代码,实现部门字段的更新 if (Request["saveInfo"] != null) { Ec_tab val = new Ec_tab(); val.Tabid = 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_tab> .Factory(conn).Update(val, Ec_tab.Attribute.Tabid); Response.Write("修改用户信息成功"); } Response.End(); }
protected void Page_Load(object sender, EventArgs e) { #region//默认隐藏的列 //hideTableColumnList = new List<AttributeItem>(); //hideTableColumnList.Add(Ec_tab.Attribute.EXP1); //hideTableColumnList.Add(Ec_tab.Attribute.EXP2); //hideTableColumnList.Add(Ec_tab.Attribute.EXP3); //valObj.LoadAllAttributes(true);//暂时加此代码,以后框架更新将不需要 //valObj.Remove(hideTableColumnList); //hideFindColumnList = new List<AttributeItem>(); //hideFindColumnList.Add(Ec_tab.Attribute.EXP1); //hideFindColumnList.Add(Ec_tab.Attribute.EXP2); //hideFindColumnList.Add(Ec_tab.Attribute.EXP3); #endregion condObj.OrderBy(Ec_tab.Attribute.Tabid, Order.Desc); if (!IsPostBack) { btnFind.Text = LanguageService.GetLanguageString("btnFind", "查询"); aspPager.PageSize = 10; aspPager.CurrentPageIndex = 1; if (!string.IsNullOrEmpty(Request["ids"])) { Ec_tab roleOld = new Ec_tab(); roleOld.Where(Ec_tab.Attribute.Tabid, Request["ids"].ToString()); listObj = BLLTable <Ec_tab> .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].Tabid + "',Name:'" + listObj[i].Tabid + "'}";//这里的Name用于显示在列表中,请自行重定义。 hidInitIDS.Value += listObj[i].Tabid; } } try { listObj = BLLTable <Ec_tab> .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["DelTabid"] != null) { int re = BLLTable<Ec_tab>.Factory(conn).Delete(Ec_tab.Attribute.Tabid, Request["DelTabid"]); if (re > 0) { Response.Write("1");//����������� ����0 ��ʾ�����ɹ���Ҳ����ֱ����� �ַ������ͻ��˽��������ַ�����Ϣ��Ϊ��ʾ } else { Response.Write("ɾ��ʧ�ܣ�"); } } //���б�������ɾ����ť��ͨ��AJAXִ������ĺ�̨���룬ɾ��������¼ if (Request["DelKeyIDS"] != null) { Ec_tab cond = new Ec_tab(); cond.In(Ec_tab.Attribute.Tabid, Request["DelKeyIDS"]); int re = BLLTable<Ec_tab>.Factory(conn).Delete(cond); if (re > 0) { Response.Write("1");//����������� ����0 ��ʾ�����ɹ���Ҳ����ֱ����� �ַ������ͻ��˽��������ַ�����Ϣ��Ϊ��ʾ } else { Response.Write("ɾ��ʧ�ܣ�"); } } //���û���ϸ��Ϣ�鿴�༭ҳ�棬�㱣��ʱ��ͨ��AJAXִ������ĺ�̨���룬ʵ�ֲ����ֶεĸ��� if (Request["saveInfo"] != null) { Ec_tab val = new Ec_tab(); val.Tabid = 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_tab>.Factory(conn).Update(val, Ec_tab.Attribute.Tabid); Response.Write("���û���Ϣ�ɹ�"); } Response.End(); }
private void BindList(Ec_tab condObj, int curPage) { if (condObj.af_PageByAttributeItem == null)//如果不存在用户定义的分页排序属性,则用主键属性排序 { condObj.af_PageBy(Ec_tab.Attribute.Tabid, Order.Desc); } #region//数据权限条件 #endregion //condObj.PID = decimal.Parse(pid); listObj = BLLTable <Ec_tab> .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_tab>(hidCondition.Value); } listObj = BLLTable<Ec_tab>.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 aspPager_PageChanged(object sender, EventArgs e) { try { if (hidCondition.Value != "") { condObj = JsonServiceBase.FromJson <Ec_tab>(hidCondition.Value); } listObj = BLLTable <Ec_tab> .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_tab(); if(txtTabid.Value !="" ) condObj.Like_OR(Ec_tab.Attribute.Tabid, Convert.ToInt32(txtTabid.Value)); if(txtName.Value !="" ) condObj.Like_OR(Ec_tab.Attribute.Name, Convert.ToString(txtName.Value)); if(txtPresence.Value !="" ) condObj.Like_OR(Ec_tab.Attribute.Presence, Convert.ToInt32(txtPresence.Value)); if(txtTabsequence.Value !="" ) condObj.Like_OR(Ec_tab.Attribute.Tabsequence, Convert.ToInt32(txtTabsequence.Value)); if(txtTablabel.Value !="" ) condObj.Like_OR(Ec_tab.Attribute.Tablabel, Convert.ToString(txtTablabel.Value)); if(txtModifiedby.Value !="" ) condObj.Like_OR(Ec_tab.Attribute.Modifiedby, Convert.ToInt32(txtModifiedby.Value)); if(txtModifiedtime.Value !="" ) condObj.Like_OR(Ec_tab.Attribute.Modifiedtime, Convert.ToInt32(txtModifiedtime.Value)); if(txtCustomized.Value !="" ) condObj.Like_OR(Ec_tab.Attribute.Customized, Convert.ToInt32(txtCustomized.Value)); if(txtReportable.Value !="" ) condObj.Like_OR(Ec_tab.Attribute.Reportable, Convert.ToInt32(txtReportable.Value)); try { hidCondition.Value = condObj.ToJson(20); listObj = BLLTable<Ec_tab>.Factory(conn).SelectByPage(valObj, condObj, aspPager.PageSize, 1, ref recount); repList.DataSource = listObj; repList.DataBind(); } catch (Exception ex) { litWarn.Text = ex.Message; } }
private void BindList(Ec_tab condObj, int curPage) { if (condObj.af_PageByAttributeItem == null)//����������û�����ķ�ҳ�������ԣ����������������� condObj.af_PageBy(Ec_tab.Attribute.Tabid, Order.Desc); #region//����Ȩ������ #endregion //condObj.PID = decimal.Parse(pid); listObj = BLLTable<Ec_tab>.Factory(conn).SelectByPage(valObj, condObj, aspPager.PageSize, curPage, ref recount); repList.DataSource = listObj; repList.DataBind(); aspPager.RecordCount = recount; }
protected void btnFind_Click(object sender, EventArgs e) { condObj = new Ec_tab(); if (txtTabid.Value != "") { condObj.Like(Ec_tab.Attribute.Tabid, Convert.ToInt32(txtTabid.Value)); } if (txtName.Value != "") { condObj.Like(Ec_tab.Attribute.Name, Convert.ToString(txtName.Value)); } if (txtPresence.Value != "") { condObj.Like(Ec_tab.Attribute.Presence, Convert.ToInt32(txtPresence.Value)); } if (txtTabsequence.Value != "") { condObj.Like(Ec_tab.Attribute.Tabsequence, Convert.ToInt32(txtTabsequence.Value)); } if (txtTablabel.Value != "") { condObj.Like(Ec_tab.Attribute.Tablabel, Convert.ToString(txtTablabel.Value)); } if (txtModifiedby.Value != "") { condObj.Like(Ec_tab.Attribute.Modifiedby, Convert.ToInt32(txtModifiedby.Value)); } if (txtModifiedtime.Value != "") { condObj.Like(Ec_tab.Attribute.Modifiedtime, Convert.ToInt32(txtModifiedtime.Value)); } if (txtCustomized.Value != "") { condObj.Like(Ec_tab.Attribute.Customized, Convert.ToInt32(txtCustomized.Value)); } if (txtReportable.Value != "") { condObj.Like(Ec_tab.Attribute.Reportable, Convert.ToInt32(txtReportable.Value)); } hidCondition.Value = condObj.ToJson(20); BindList(condObj, 1); }
protected void btnFind_Click(object sender, EventArgs e) { try { condObj = new Ec_tab(); if (txtTabid.Value != "") { condObj.Like(Ec_tab.Attribute.Tabid, Convert.ToInt32(txtTabid.Value)); } if (txtName.Value != "") { condObj.Like(Ec_tab.Attribute.Name, Convert.ToString(txtName.Value)); } if (txtPresence.Value != "") { condObj.Like(Ec_tab.Attribute.Presence, Convert.ToInt32(txtPresence.Value)); } if (txtTabsequence.Value != "") { condObj.Like(Ec_tab.Attribute.Tabsequence, Convert.ToInt32(txtTabsequence.Value)); } if (txtTablabel.Value != "") { condObj.Like(Ec_tab.Attribute.Tablabel, Convert.ToString(txtTablabel.Value)); } if (txtModifiedby.Value != "") { condObj.Like(Ec_tab.Attribute.Modifiedby, Convert.ToInt32(txtModifiedby.Value)); } if (txtModifiedtime.Value != "") { condObj.Like(Ec_tab.Attribute.Modifiedtime, Convert.ToInt32(txtModifiedtime.Value)); } if (txtCustomized.Value != "") { condObj.Like(Ec_tab.Attribute.Customized, Convert.ToInt32(txtCustomized.Value)); } if (txtReportable.Value != "") { condObj.Like(Ec_tab.Attribute.Reportable, Convert.ToInt32(txtReportable.Value)); } listObj = BLLTable <Ec_tab> .Factory(conn).SelectByPage(valObj, condObj, aspPager.PageSize, 1, ref recount); repCus.DataSource = listObj; repCus.DataBind(); } catch (Exception ex) { litWarn.Text = ex.Message; } aspPager.RecordCount = recount; }
protected void Page_Load(object sender, EventArgs e) { title = valObj._ZhName + "详细"; Page.Title = title; if (!IsPostBack) { try { if (!string.IsNullOrEmpty(Request["Tabid"])) { valObj = BLLTable <Ec_tab> .Factory(conn).GetRowData(Ec_tab.Attribute.Tabid, Request["Tabid"]); if (valObj == null) { return; } txtTabid.Text = Convert.ToString(valObj.Tabid);//Convert.ToInt32 txtName.Text = Convert.ToString(valObj.Name);//Convert.ToString txtPresence.Text = Convert.ToString(valObj.Presence);//Convert.ToInt32 txtTabsequence.Text = Convert.ToString(valObj.Tabsequence);//Convert.ToInt32 txtTablabel.Text = Convert.ToString(valObj.Tablabel);//Convert.ToString txtModifiedby.Text = Convert.ToString(valObj.Modifiedby);//Convert.ToInt32 txtModifiedtime.Text = Convert.ToString(valObj.Modifiedtime);//Convert.ToInt32 txtCustomized.Text = Convert.ToString(valObj.Customized);//Convert.ToInt32 txtReportable.Text = Convert.ToString(valObj.Reportable);//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 Page_Load(object sender, EventArgs e) { title = valObj._ZhName + "�༭"; Page.Title = title; if (!string.IsNullOrEmpty(Request["Tabid"])) { keyid = Request["Tabid"]; } if (!string.IsNullOrEmpty(Request["KeyID"])) { keyid = Request["KeyID"]; } if (!IsPostBack) { this.txtTabid.Disabled = true; this.txtTabid.Value = "0"; this.txtTabid.Attributes["class"] = "dis"; try { if (keyid != "") { valObj = BLLTable<Ec_tab>.Factory(conn).GetRowData(Ec_tab.Attribute.Tabid, keyid); if(valObj==null) return ; txtTabid.Value = Convert.ToString(valObj.Tabid);//Convert.ToInt32 txtName.Value = Convert.ToString(valObj.Name);//Convert.ToString txtPresence.Value = Convert.ToString(valObj.Presence);//Convert.ToInt32 txtTabsequence.Value = Convert.ToString(valObj.Tabsequence);//Convert.ToInt32 txtTablabel.Value = Convert.ToString(valObj.Tablabel);//Convert.ToString txtModifiedby.Value = Convert.ToString(valObj.Modifiedby);//Convert.ToInt32 txtModifiedtime.Value = Convert.ToString(valObj.Modifiedtime);//Convert.ToInt32 txtCustomized.Value = Convert.ToString(valObj.Customized);//Convert.ToInt32 txtReportable.Value = Convert.ToString(valObj.Reportable);//Convert.ToInt32 } } catch (Exception ex) { litWarn.Text = ex.Message; } } }
protected void Page_Load(object sender, EventArgs e) { #region//Ĭ�����ص��� //hideTableColumnList = new List<AttributeItem>(); //hideTableColumnList.Add(Ec_tab.Attribute.EXP1); //hideTableColumnList.Add(Ec_tab.Attribute.EXP2); //hideTableColumnList.Add(Ec_tab.Attribute.EXP3); //valObj.LoadAllAttributes(true);//��ʱ�Ӵ˴��룬�Ժ��ܸ��½�����Ҫ //valObj.Remove(hideTableColumnList); //hideFindColumnList = new List<AttributeItem>(); //hideFindColumnList.Add(Ec_tab.Attribute.EXP1); //hideFindColumnList.Add(Ec_tab.Attribute.EXP2); //hideFindColumnList.Add(Ec_tab.Attribute.EXP3); #endregion condObj.OrderBy(Ec_tab.Attribute.Tabid, Order.Desc); if (!IsPostBack) { btnFind.Text = LanguageService.GetLanguageString("btnFind", "��ѯ"); aspPager.PageSize = 10; aspPager.CurrentPageIndex = 1; if (!string.IsNullOrEmpty(Request["ids"])) { Ec_tab roleOld = new Ec_tab(); roleOld.Where(Ec_tab.Attribute.Tabid, Request["ids"].ToString()); listObj = BLLTable<Ec_tab>.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].Tabid + "',Name:'" + listObj[i].Tabid + "'}";//�����Name������ʾ���б��У��������ض��塣 hidInitIDS.Value += listObj[i].Tabid; } } try { listObj = BLLTable<Ec_tab>.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 btnOK_Click(object sender, EventArgs e) { try { Ec_tab valObj = new Ec_tab(); if(txtTabid.Value !="" ) valObj.Tabid = Convert.ToInt32(txtTabid.Value); if(txtName.Value !="" ) valObj.Name = Convert.ToString(txtName.Value); if(txtPresence.Value !="" ) valObj.Presence = Convert.ToInt32(txtPresence.Value); if(txtTabsequence.Value !="" ) valObj.Tabsequence = Convert.ToInt32(txtTabsequence.Value); if(txtTablabel.Value !="" ) valObj.Tablabel = Convert.ToString(txtTablabel.Value); if(txtModifiedby.Value !="" ) valObj.Modifiedby = Convert.ToInt32(txtModifiedby.Value); if(txtModifiedtime.Value !="" ) valObj.Modifiedtime = Convert.ToInt32(txtModifiedtime.Value); if(txtCustomized.Value !="" ) valObj.Customized = Convert.ToInt32(txtCustomized.Value); if(txtReportable.Value !="" ) valObj.Reportable = Convert.ToInt32(txtReportable.Value); if (keyid != "") { valObj.Tabid = Convert.ToInt32(keyid); count = BLLTable<Ec_tab>.Factory(conn).Update(valObj, Ec_tab.Attribute.Tabid); } else { count = BLLTable<Ec_tab>.Factory(conn).Insert(valObj, Ec_tab.Attribute.Tabid); keyid = valObj.Tabid.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 { txtTabid.Value =""; txtName.Value =""; txtPresence.Value =""; txtTabsequence.Value =""; txtTablabel.Value =""; txtModifiedby.Value =""; txtModifiedtime.Value =""; txtCustomized.Value =""; txtReportable.Value =""; } } } catch (Exception ex) { litWarn.Text = ex.Message; } }
protected void btnOK_Click(object sender, EventArgs e) { try { Ec_tab valObj = new Ec_tab(); if (txtTabid.Value != "") { valObj.Tabid = Convert.ToInt32(txtTabid.Value); } if (txtName.Value != "") { valObj.Name = Convert.ToString(txtName.Value); } if (txtPresence.Value != "") { valObj.Presence = Convert.ToInt32(txtPresence.Value); } if (txtTabsequence.Value != "") { valObj.Tabsequence = Convert.ToInt32(txtTabsequence.Value); } if (txtTablabel.Value != "") { valObj.Tablabel = Convert.ToString(txtTablabel.Value); } if (txtModifiedby.Value != "") { valObj.Modifiedby = Convert.ToInt32(txtModifiedby.Value); } if (txtModifiedtime.Value != "") { valObj.Modifiedtime = Convert.ToInt32(txtModifiedtime.Value); } if (txtCustomized.Value != "") { valObj.Customized = Convert.ToInt32(txtCustomized.Value); } if (txtReportable.Value != "") { valObj.Reportable = Convert.ToInt32(txtReportable.Value); } if (keyid != "") { valObj.Tabid = Convert.ToInt32(keyid); count = BLLTable <Ec_tab> .Factory(conn).Update(valObj, Ec_tab.Attribute.Tabid); } else { count = BLLTable <Ec_tab> .Factory(conn).Insert(valObj, Ec_tab.Attribute.Tabid); keyid = valObj.Tabid.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 { txtTabid.Value = ""; txtName.Value = ""; txtPresence.Value = ""; txtTabsequence.Value = ""; txtTablabel.Value = ""; txtModifiedby.Value = ""; txtModifiedtime.Value = ""; txtCustomized.Value = ""; txtReportable.Value = ""; } } } catch (Exception ex) { litWarn.Text = ex.Message; } }