コード例 #1
0
    protected void btnFind_Click(object sender, EventArgs e)
    {
        condObj = new WEC_CUSTOM_MODEL_SET();

        if(txtWEC_CUSTOM_MODEL_SET_ID.Value !="" )
            condObj.Like(WEC_CUSTOM_MODEL_SET.Attribute.ID, Convert.ToDecimal(txtWEC_CUSTOM_MODEL_SET_ID.Value));

        if(txtWEC_CUSTOM_MODEL_SET_A_ID.Value !="" )
            condObj.Like(WEC_CUSTOM_MODEL_SET.Attribute.A_ID, Convert.ToDecimal(txtWEC_CUSTOM_MODEL_SET_A_ID.Value));

        if(txtWEC_CUSTOM_MODEL_SET_M_ID.Value !="" )
            condObj.Like(WEC_CUSTOM_MODEL_SET.Attribute.M_ID, Convert.ToDecimal(txtWEC_CUSTOM_MODEL_SET_M_ID.Value));

        try
        {
            hidCondition.Value = condObj.ToJson(20);

            listObj = BLLTable<WEC_CUSTOM_MODEL_SET>.Factory(conn).SelectByPage(valObj, condObj, aspPager.PageSize, 1, ref recount);
            repList.DataSource = listObj;
            repList.DataBind();
        }
        catch (Exception ex)
        {
             litWarn.Text = ex.Message;
        }
    }
コード例 #2
0
    private int updateDate(int type, int intId)
    {
        int intret = -1;

        using (Transaction t = new Transaction("conn"))
        {
            try
            {
                V_WEC_CUSTOM_MODEL_SET cond = new V_WEC_CUSTOM_MODEL_SET();
                cond.TYPE = type;
                cond.A_ID = Convert.ToInt32(userBase2.Curraid);
                V_WEC_CUSTOM_MODEL_SET obj = BLLTable <V_WEC_CUSTOM_MODEL_SET> .Factory(t).GetRowData(cond);

                if (obj != null)
                {
                    //删除原来的模版
                    intret = BLLTable <WEC_CUSTOM_MODEL_SET> .Factory(t).Delete(Convert.ToInt32(obj.ID));
                }

                //添加新的模版
                WEC_CUSTOM_MODEL_SET valObj = new WEC_CUSTOM_MODEL_SET();
                valObj.M_ID = intId;
                valObj.A_ID = Convert.ToInt32(userBase2.Curraid);
                intret      = BLLTable <WEC_CUSTOM_MODEL_SET> .Factory(t).Insert(valObj, WEC_CUSTOM_MODEL_SET.Attribute.ID);

                t.Commit();
            }
            catch
            {
                t.RollBack();
                return(intret);
            }
        }
        return(intret);
    }
コード例 #3
0
 protected void aspPager_PageChanged(object sender, EventArgs e)
 {
     if (hidCondition.Value != "")
     {
         condObj = JsonServiceBase.FromJson <WEC_CUSTOM_MODEL_SET>(hidCondition.Value);
     }
     BindList(condObj, aspPager.CurrentPageIndex);
 }
コード例 #4
0
 protected void aspPager_PageChanged(object sender, EventArgs e)
 {
     if (hidCondition.Value != "")
     {
         condObj = JsonServiceBase.FromJson<WEC_CUSTOM_MODEL_SET>(hidCondition.Value);
     }
     BindList(condObj, aspPager.CurrentPageIndex);
 }
コード例 #5
0
 protected void btnSetPageSize_Click(object sender, EventArgs e)
 {
     aspPager.PageSize = int.Parse(txtPageSize.Value);
     if (hidCondition.Value != "")
     {
         condObj = JsonServiceBase.FromJson <WEC_CUSTOM_MODEL_SET>(hidCondition.Value);
     }
     BindList(condObj, aspPager.CurrentPageIndex);
 }
コード例 #6
0
    protected void Page_Load(object sender, EventArgs e)
    {
        //zlg 如果有模块,则先配置
        valObj.setConn(conn).setModule(ModuleName);

        #region//默认隐藏的列
        //hideTableColumnList = new List<AttributeItem>();
        //hideTableColumnList.Add(WEC_CUSTOM_MODEL_SET.Attribute.EXP1);
        //hideTableColumnList.Add(WEC_CUSTOM_MODEL_SET.Attribute.EXP2);
        //hideTableColumnList.Add(WEC_CUSTOM_MODEL_SET.Attribute.EXP3);
        //valObj.LoadAllAttributes(true);//暂时加此代码,以后框架更新将不需要
        //valObj.Remove(hideTableColumnList);

        //hideFindColumnList = new List<AttributeItem>();
        //hideFindColumnList.Add(WEC_CUSTOM_MODEL_SET.Attribute.EXP1);
        //hideFindColumnList.Add(WEC_CUSTOM_MODEL_SET.Attribute.EXP2);
        //hideFindColumnList.Add(WEC_CUSTOM_MODEL_SET.Attribute.EXP3);
        #endregion
        condObj.OrderBy(WEC_CUSTOM_MODEL_SET.Attribute.ID, Order.Desc);

        if (!IsPostBack)
        {
            btnFind.Text              = LanguageService.GetLanguageString("btnFind", "查询");
            aspPager.PageSize         = 10;
            aspPager.CurrentPageIndex = 1;

            if (!string.IsNullOrEmpty(Request["ids"]))
            {
                WEC_CUSTOM_MODEL_SET roleOld = new WEC_CUSTOM_MODEL_SET();
                roleOld.Where(WEC_CUSTOM_MODEL_SET.Attribute.ID, Request["ids"].ToString());
                listObj = BLLTable <WEC_CUSTOM_MODEL_SET> .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].ID + "',Name:'" + listObj[i].ID + "'}";//这里的Name用于显示在列表中,请自行重定义。
                    hidInitIDS.Value += listObj[i].ID;
                }
            }
            try
            {
                listObj = BLLTable <WEC_CUSTOM_MODEL_SET> .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;
            }
        }
    }
コード例 #7
0
 protected void btnSetPageSize_Click(object sender, EventArgs e)
 {
     aspPager.PageSize = int.Parse(txtPageSize.Value);
     if (hidCondition.Value != "")
     {
         condObj = JsonServiceBase.FromJson<WEC_CUSTOM_MODEL_SET>(hidCondition.Value);
     }
     BindList(condObj, aspPager.CurrentPageIndex);
 }
コード例 #8
0
    protected void Page_Load(object sender, EventArgs e)
    {
        //zlg 如果有模块,则先配置
        valObj.setConn(conn).setModule(ModuleName);

        title      = valObj._ZhName + "详细";
        Page.Title = title;
        if (!IsPostBack)
        {
            try
            {
                if (!string.IsNullOrEmpty(Request["ID"]))
                {
                    valObj = BLLTable <WEC_CUSTOM_MODEL_SET> .Factory(conn).GetRowData(WEC_CUSTOM_MODEL_SET.Attribute.ID, Request["ID"]);

                    if (valObj == null)
                    {
                        return;
                    }


                    txtWEC_CUSTOM_MODEL_SET_ID.Text = Convert.ToString(valObj.ID);//Convert.ToDecimal


                    txtWEC_CUSTOM_MODEL_SET_A_ID.Text = Convert.ToString(valObj.A_ID);//Convert.ToDecimal


                    txtWEC_CUSTOM_MODEL_SET_M_ID.Text = Convert.ToString(valObj.M_ID);//Convert.ToDecimal
                }
            }
            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();
            }
        }
    }
コード例 #9
0
    protected void btnFind_Click(object sender, EventArgs e)
    {
        condObj = new WEC_CUSTOM_MODEL_SET();

        if(txtWEC_CUSTOM_MODEL_SET_A_ID.Value != "" )
            condObj.Like(WEC_CUSTOM_MODEL_SET.Attribute.A_ID, Convert.ToDecimal(txtWEC_CUSTOM_MODEL_SET_A_ID.Value));

        hidCondition.Value = condObj.ToJson(20);

        BindList(condObj, 1);
    }
コード例 #10
0
    protected void Page_Load(object sender, EventArgs e)
    {
        //���б�����ɾ����ť��ͨ��AJAXִ������ĺ�̨���룬ɾ��һ����¼
        if (Request["DelID"] != null)
        {
            int re = BLLTable<WEC_CUSTOM_MODEL_SET>.Factory(conn).Delete(WEC_CUSTOM_MODEL_SET.Attribute.ID, Request["DelID"]);
            if (re > 0)
            {
                Response.Write("1");//����������� ����0 ��ʾ�����ɹ���Ҳ����ֱ����� �ַ������ͻ��˽��������ַ�����Ϣ��Ϊ��ʾ
            }
            else
            {
                Response.Write("ɾ��ʧ�ܣ�");
            }
        }

        //���б�������ɾ����ť��ͨ��AJAXִ������ĺ�̨���룬ɾ��������¼
        if (Request["DelKeyIDS"] != null)
        {
            WEC_CUSTOM_MODEL_SET cond = new WEC_CUSTOM_MODEL_SET();
            cond.In(WEC_CUSTOM_MODEL_SET.Attribute.ID, Request["DelKeyIDS"]);
            int re = BLLTable<WEC_CUSTOM_MODEL_SET>.Factory(conn).Delete(cond);
            if (re > 0)
            {
                Response.Write("1");//����������� ����0 ��ʾ�����ɹ���Ҳ����ֱ����� �ַ������ͻ��˽��������ַ�����Ϣ��Ϊ��ʾ
            }
            else
            {
                Response.Write("ɾ��ʧ�ܣ�");
            }
        }

        //���û���ϸ��Ϣ�鿴�༭ҳ�棬�㱣��ʱ��ͨ��AJAXִ������ĺ�̨���룬ʵ�ֲ����ֶεĸ���
        if (Request["saveInfo"] != null)
        {
            WEC_CUSTOM_MODEL_SET val = new WEC_CUSTOM_MODEL_SET();
            val.ID = Convert.ToDecimal(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<WEC_CUSTOM_MODEL_SET>.Factory(conn).Update(val, WEC_CUSTOM_MODEL_SET.Attribute.ID);
            Response.Write("�޸��û���Ϣ�ɹ�");

        }
        Response.End();
    }
コード例 #11
0
    protected void btnFind_Click(object sender, EventArgs e)
    {
        condObj = new WEC_CUSTOM_MODEL_SET();

        if (txtWEC_CUSTOM_MODEL_SET_A_ID.Value != "")
        {
            condObj.Like(WEC_CUSTOM_MODEL_SET.Attribute.A_ID, Convert.ToDecimal(txtWEC_CUSTOM_MODEL_SET_A_ID.Value));
        }


        hidCondition.Value = condObj.ToJson(20);

        BindList(condObj, 1);
    }
コード例 #12
0
    protected void Page_Load(object sender, EventArgs e)
    {
        //zlg 如果有模块,则先配置
        valObj.setConn(conn).setModule(ModuleName);

        title      = valObj._ZhName + "编辑";
        Page.Title = title;
        if (!string.IsNullOrEmpty(Request["ID"]))
        {
            keyid = Request["ID"];
        }

        if (!string.IsNullOrEmpty(Request["KeyID"]))
        {
            keyid = Request["KeyID"];
        }
        if (!string.IsNullOrEmpty(Request["record"]))
        {
            keyid = Request["record"];
        }
        if (!IsPostBack)
        {
            this.txtWEC_CUSTOM_MODEL_SET_ID.Disabled            = true; this.txtWEC_CUSTOM_MODEL_SET_ID.Value = "0";
            this.txtWEC_CUSTOM_MODEL_SET_ID.Attributes["class"] = "hide";
            try
            {
                if (keyid != "")
                {
                    valObj = BLLTable <WEC_CUSTOM_MODEL_SET> .Factory(conn).GetRowData(WEC_CUSTOM_MODEL_SET.Attribute.ID, keyid);

                    if (valObj == null)
                    {
                        return;
                    }


                    txtWEC_CUSTOM_MODEL_SET_ID.Value = Convert.ToString(valObj.ID);     //Convert.ToDecimal

                    txtWEC_CUSTOM_MODEL_SET_A_ID.Value = Convert.ToString(valObj.A_ID); //Convert.ToDecimal

                    txtWEC_CUSTOM_MODEL_SET_M_ID.Value = Convert.ToString(valObj.M_ID); //Convert.ToDecimal
                }
            }
            catch (Exception ex)
            {
                litWarn.Text = ex.Message;
            }
        }
    }
コード例 #13
0
    protected void Page_Load(object sender, EventArgs e)
    {
        //zlg �����ģ�飬��������
        valObj.setConn(conn).setModule(ModuleName);

        title = valObj._ZhName + "��ϸ";
        Page.Title = title;
        if (!IsPostBack)
        {
            try
            {
                if (!string.IsNullOrEmpty(Request["ID"]))
                {
                    valObj = BLLTable<WEC_CUSTOM_MODEL_SET>.Factory(conn).GetRowData(WEC_CUSTOM_MODEL_SET.Attribute.ID, Request["ID"]);
                    if(valObj==null) return ;

                    txtWEC_CUSTOM_MODEL_SET_ID.Text = Convert.ToString(valObj.ID);//Convert.ToDecimal

                    txtWEC_CUSTOM_MODEL_SET_A_ID.Text = Convert.ToString(valObj.A_ID);//Convert.ToDecimal

                    txtWEC_CUSTOM_MODEL_SET_M_ID.Text = Convert.ToString(valObj.M_ID);//Convert.ToDecimal
                }
            }
            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();
            }
        }
    }
コード例 #14
0
    protected void aspPager_PageChanged(object sender, EventArgs e)
    {
        try
        {
            if (hidCondition.Value != "")
            {
                condObj = JsonServiceBase.FromJson <WEC_CUSTOM_MODEL_SET>(hidCondition.Value);
            }
            listObj = BLLTable <WEC_CUSTOM_MODEL_SET> .Factory(conn).SelectByPage(valObj, condObj, aspPager.PageSize, aspPager.CurrentPageIndex, ref recount);

            repCus.DataSource = listObj;
            repCus.DataBind();
        }
        catch (Exception ex)
        {
            litWarn.Text = ex.Message;
        }
    }
コード例 #15
0
 protected void aspPager_PageChanged(object sender, EventArgs e)
 {
     try
     {
         recount = aspPager.RecordCount;
         if (hidCondition.Value != "")
         {
             condObj = JsonServiceBase.FromJson<WEC_CUSTOM_MODEL_SET>(hidCondition.Value);
         }
         List<WEC_CUSTOM_MODEL_SET> listVal = BLLTable<WEC_CUSTOM_MODEL_SET>.Factory(conn).SelectByPage(valObj, condObj, aspPager.PageSize, aspPager.CurrentPageIndex, ref recount);
         repList.DataSource = listVal;
         repList.DataBind();
     }
     catch (Exception ex)
     {
          litWarn.Text = ex.Message;
     }
 }
コード例 #16
0
    private void BindList(WEC_CUSTOM_MODEL_SET condObj, int curPage)
    {
        if (condObj.af_PageByAttributeItem == null)                             //如果不存在用户定义的分页排序属性,则用主键属性排序
        {
            condObj.af_PageBy(WEC_CUSTOM_MODEL_SET.Attribute.A_ID, Order.Desc); //.ID 改成 .A_ID
        }
        #region                                                                 //数据权限条件

        #endregion
        //condObj.PID = decimal.Parse(pid);
        //valObj = new WEC_CUSTOM_MODEL_SET();
        valObj.A_ID = 1;
        condObj.Where("1=1 GROUP BY A_ID");
        listObj = BLLTable <WEC_CUSTOM_MODEL_SET> .Factory(conn).SelectByPage(valObj, condObj, aspPager.PageSize, curPage, ref recount);

        repList.DataSource = listObj;
        repList.DataBind();
        aspPager.RecordCount = recount;
    }
コード例 #17
0
    protected void btnFind_Click(object sender, EventArgs e)
    {
        try
        {
            condObj = new WEC_CUSTOM_MODEL_SET();



            if (txtWEC_CUSTOM_MODEL_SET_ID.Value != "")
            {
                condObj.Like(WEC_CUSTOM_MODEL_SET.Attribute.ID, Convert.ToDecimal(txtWEC_CUSTOM_MODEL_SET_ID.Value));
            }


            if (txtWEC_CUSTOM_MODEL_SET_A_ID.Value != "")
            {
                condObj.Like(WEC_CUSTOM_MODEL_SET.Attribute.A_ID, Convert.ToDecimal(txtWEC_CUSTOM_MODEL_SET_A_ID.Value));
            }


            if (txtWEC_CUSTOM_MODEL_SET_M_ID.Value != "")
            {
                condObj.Like(WEC_CUSTOM_MODEL_SET.Attribute.M_ID, Convert.ToDecimal(txtWEC_CUSTOM_MODEL_SET_M_ID.Value));
            }

            listObj = BLLTable <WEC_CUSTOM_MODEL_SET> .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;
    }
コード例 #18
0
    protected void Page_Load(object sender, EventArgs e)
    {
        //zlg �����ģ�飬��������
        valObj.setConn(conn).setModule(ModuleName);

        #region//Ĭ�����ص���
        //hideTableColumnList = new List<AttributeItem>();
        //hideTableColumnList.Add(WEC_CUSTOM_MODEL_SET.Attribute.EXP1);
        //hideTableColumnList.Add(WEC_CUSTOM_MODEL_SET.Attribute.EXP2);
        //hideTableColumnList.Add(WEC_CUSTOM_MODEL_SET.Attribute.EXP3);
        //valObj.LoadAllAttributes(true);//��ʱ�Ӵ˴��룬�Ժ��ܸ��½�����Ҫ
        //valObj.Remove(hideTableColumnList);

        //hideFindColumnList = new List<AttributeItem>();
        //hideFindColumnList.Add(WEC_CUSTOM_MODEL_SET.Attribute.EXP1);
        //hideFindColumnList.Add(WEC_CUSTOM_MODEL_SET.Attribute.EXP2);
        //hideFindColumnList.Add(WEC_CUSTOM_MODEL_SET.Attribute.EXP3);
        #endregion
        condObj.OrderBy(WEC_CUSTOM_MODEL_SET.Attribute.ID, Order.Desc);

        if (!IsPostBack)
        {
            btnFind.Text = LanguageService.GetLanguageString("btnFind", "��ѯ");
            aspPager.PageSize = 10;
            aspPager.CurrentPageIndex = 1;

            if (!string.IsNullOrEmpty(Request["ids"]))
            {
                WEC_CUSTOM_MODEL_SET roleOld = new WEC_CUSTOM_MODEL_SET();
                roleOld.Where(WEC_CUSTOM_MODEL_SET.Attribute.ID, Request["ids"].ToString());
                listObj = BLLTable<WEC_CUSTOM_MODEL_SET>.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].ID + "',Name:'" + listObj[i].ID + "'}";//�����Name������ʾ���б��У��������ض��塣
                    hidInitIDS.Value += listObj[i].ID;
                }
            }
            try
            {

                listObj = BLLTable<WEC_CUSTOM_MODEL_SET>.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;
            }

        }
    }
コード例 #19
0
    protected void Page_Load(object sender, EventArgs e)
    {
        //zlg �����ģ�飬��������
        valObj.setConn(conn).setModule(ModuleName);

        title = valObj._ZhName + "�༭";
        Page.Title = title;
        if (!string.IsNullOrEmpty(Request["ID"]))
        {
            keyid = Request["ID"];
        }

        if (!string.IsNullOrEmpty(Request["KeyID"]))
        {
            keyid = Request["KeyID"];
        }
        if (!string.IsNullOrEmpty(Request["record"]))
        {
            keyid = Request["record"];
        }
        if (!IsPostBack)
        {

            this.txtWEC_CUSTOM_MODEL_SET_ID.Disabled = true; this.txtWEC_CUSTOM_MODEL_SET_ID.Value = "0";
            this.txtWEC_CUSTOM_MODEL_SET_ID.Attributes["class"] = "hide";
            try
            {
                if (keyid != "")
                {
                    valObj = BLLTable<WEC_CUSTOM_MODEL_SET>.Factory(conn).GetRowData(WEC_CUSTOM_MODEL_SET.Attribute.ID, keyid);
                    if(valObj==null) return ;

                    txtWEC_CUSTOM_MODEL_SET_ID.Value = Convert.ToString(valObj.ID);//Convert.ToDecimal

                    txtWEC_CUSTOM_MODEL_SET_A_ID.Value = Convert.ToString(valObj.A_ID);//Convert.ToDecimal

                    txtWEC_CUSTOM_MODEL_SET_M_ID.Value = Convert.ToString(valObj.M_ID);//Convert.ToDecimal
                }
            }
            catch (Exception ex)
            {
                litWarn.Text = ex.Message;
            }
        }
    }
コード例 #20
0
    private int updateDate(int type, int intId)
    {
        int intret = -1;

        using (Transaction t = new Transaction("conn"))
        {
            try
            {
                V_WEC_CUSTOM_MODEL_SET cond = new V_WEC_CUSTOM_MODEL_SET();
                cond.TYPE = type;
                cond.A_ID = Convert.ToInt32(userBase2.Curraid);
                V_WEC_CUSTOM_MODEL_SET obj = BLLTable<V_WEC_CUSTOM_MODEL_SET>.Factory(t).GetRowData(cond);

                if (obj != null)
                {
                    //删除原来的模版
                    intret = BLLTable<WEC_CUSTOM_MODEL_SET>.Factory(t).Delete(Convert.ToInt32(obj.ID));
                }

                //添加新的模版
                WEC_CUSTOM_MODEL_SET valObj = new WEC_CUSTOM_MODEL_SET();
                valObj.M_ID = intId;
                valObj.A_ID = Convert.ToInt32(userBase2.Curraid);
                intret = BLLTable<WEC_CUSTOM_MODEL_SET>.Factory(t).Insert(valObj, WEC_CUSTOM_MODEL_SET.Attribute.ID);

                t.Commit();
            }
            catch
            {
                t.RollBack();
                return intret;
            }
        }
        return intret;
    }
コード例 #21
0
    protected void btnOK_Click(object sender, EventArgs e)
    {
        try
        {
            WEC_CUSTOM_MODEL_SET valObj = new WEC_CUSTOM_MODEL_SET();

            if(txtWEC_CUSTOM_MODEL_SET_ID.Value !="" )
                valObj.ID = Convert.ToDecimal(txtWEC_CUSTOM_MODEL_SET_ID.Value);

            if(txtWEC_CUSTOM_MODEL_SET_A_ID.Value !="" )
                valObj.A_ID = Convert.ToDecimal(txtWEC_CUSTOM_MODEL_SET_A_ID.Value);

            if(txtWEC_CUSTOM_MODEL_SET_M_ID.Value !="" )
                valObj.M_ID = Convert.ToDecimal(txtWEC_CUSTOM_MODEL_SET_M_ID.Value);

            if (keyid != "")
            {
                valObj.ID = Convert.ToDecimal(keyid);
                count = BLLTable<WEC_CUSTOM_MODEL_SET>.Factory(conn).Update(valObj, WEC_CUSTOM_MODEL_SET.Attribute.ID);
            }
            else
            {
                count = BLLTable<WEC_CUSTOM_MODEL_SET>.Factory(conn).Insert(valObj, WEC_CUSTOM_MODEL_SET.Attribute.ID);
                keyid = valObj.ID.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", "if (window.opener){window.opener.returnValue = '" + dataStr + "';}else{window.returnValue = '" + dataStr + "';}window.close();", true);
                    }
                    else
                    {
                        ScriptManager.RegisterStartupScript(Page, this.GetType(), "goto", "if (window.opener){window.opener.returnValue = 're';}else{window.returnValue = 're';}window.close();", true);
                    }
                }
                else
                {

                    txtWEC_CUSTOM_MODEL_SET_ID.Value ="";

                    txtWEC_CUSTOM_MODEL_SET_A_ID.Value ="";

                    txtWEC_CUSTOM_MODEL_SET_M_ID.Value ="";
                }
            }
        }
        catch (Exception ex)
        {
            litWarn.Text = ex.Message;
        }
    }
コード例 #22
0
    protected void btnOK_Click(object sender, EventArgs e)
    {
        try
        {
            WEC_CUSTOM_MODEL_SET valObj = new WEC_CUSTOM_MODEL_SET();


            if (txtWEC_CUSTOM_MODEL_SET_ID.Value != "")
            {
                valObj.ID = Convert.ToDecimal(txtWEC_CUSTOM_MODEL_SET_ID.Value);
            }


            if (txtWEC_CUSTOM_MODEL_SET_A_ID.Value != "")
            {
                valObj.A_ID = Convert.ToDecimal(txtWEC_CUSTOM_MODEL_SET_A_ID.Value);
            }


            if (txtWEC_CUSTOM_MODEL_SET_M_ID.Value != "")
            {
                valObj.M_ID = Convert.ToDecimal(txtWEC_CUSTOM_MODEL_SET_M_ID.Value);
            }

            if (keyid != "")
            {
                valObj.ID = Convert.ToDecimal(keyid);
                count     = BLLTable <WEC_CUSTOM_MODEL_SET> .Factory(conn).Update(valObj, WEC_CUSTOM_MODEL_SET.Attribute.ID);
            }
            else
            {
                count = BLLTable <WEC_CUSTOM_MODEL_SET> .Factory(conn).Insert(valObj, WEC_CUSTOM_MODEL_SET.Attribute.ID);

                keyid = valObj.ID.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", "if (window.opener){window.opener.returnValue = '" + dataStr + "';}else{window.returnValue = '" + dataStr + "';}window.close();", true);
                    }
                    else
                    {
                        ScriptManager.RegisterStartupScript(Page, this.GetType(), "goto", "if (window.opener){window.opener.returnValue = 're';}else{window.returnValue = 're';}window.close();", true);
                    }
                }
                else
                {
                    txtWEC_CUSTOM_MODEL_SET_ID.Value = "";


                    txtWEC_CUSTOM_MODEL_SET_A_ID.Value = "";


                    txtWEC_CUSTOM_MODEL_SET_M_ID.Value = "";
                }
            }
        }
        catch (Exception ex)
        {
            litWarn.Text = ex.Message;
        }
    }
コード例 #23
0
    private void BindList(WEC_CUSTOM_MODEL_SET condObj, int curPage)
    {
        if (condObj.af_PageByAttributeItem == null)//����������û�����ķ�ҳ�������ԣ�����������������
            condObj.af_PageBy(WEC_CUSTOM_MODEL_SET.Attribute.A_ID, Order.Desc);//.ID �ij� .A_ID

        #region//����Ȩ������

        #endregion
        //condObj.PID = decimal.Parse(pid);
        //valObj = new WEC_CUSTOM_MODEL_SET();
        valObj.A_ID = 1;
        condObj.Where ("1=1 GROUP BY A_ID");
        listObj = BLLTable<WEC_CUSTOM_MODEL_SET>.Factory(conn).SelectByPage(valObj, condObj, aspPager.PageSize, curPage, ref recount);
        repList.DataSource = listObj;
        repList.DataBind();
        aspPager.RecordCount = recount;
    }