protected void btnFind_Click(object sender, EventArgs e)
    {
        condObj = new HR_STATION_LEVEL();

        if(txtLEVEL_ID.Value !="" )
            condObj.Like_OR(HR_STATION_LEVEL.Attribute.LEVEL_ID, Convert.ToDecimal(txtLEVEL_ID.Value));

        if(txtLEVEL_NAME.Value !="" )
            condObj.Like_OR(HR_STATION_LEVEL.Attribute.LEVEL_NAME, Convert.ToString(txtLEVEL_NAME.Value));

        if(txtADDTIME.Value !="" )
            condObj.Like_OR(HR_STATION_LEVEL.Attribute.ADDTIME, Convert.ToDateTime(txtADDTIME.Value));

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

            listObj = BLLTable<HR_STATION_LEVEL>.SelectByPage(valObj, condObj, aspPager.PageSize, 1, ref recount);
            repList.DataSource = listObj;
            repList.DataBind();
        }
        catch (Exception ex)
        {
             litWarn.Text = ex.Message;
        }
    }
示例#2
0
    protected void btnFind_Click(object sender, EventArgs e)
    {
        condObj = new HR_STATION_LEVEL();



        if (txtLEVEL_ID.Value != "")
        {
            condObj.Like(HR_STATION_LEVEL.Attribute.LEVEL_ID, Convert.ToDecimal(txtLEVEL_ID.Value));
        }


        if (txtLEVEL_NAME.Value != "")
        {
            condObj.Like(HR_STATION_LEVEL.Attribute.LEVEL_NAME, Convert.ToString(txtLEVEL_NAME.Value));
        }


        if (txtADDTIME.Value != "")
        {
            condObj.Like(HR_STATION_LEVEL.Attribute.ADDTIME, Convert.ToDateTime(txtADDTIME.Value));
        }

        hidCondition.Value = condObj.ToJson(20);

        BindList(condObj, 1);
    }
 protected void aspPager_PageChanged(object sender, EventArgs e)
 {
     if (hidCondition.Value != "")
     {
         condObj = JsonServiceBase.FromJson<HR_STATION_LEVEL>(hidCondition.Value);
     }
     BindList(condObj, aspPager.CurrentPageIndex);
 }
示例#4
0
 protected void aspPager_PageChanged(object sender, EventArgs e)
 {
     if (hidCondition.Value != "")
     {
         condObj = JsonServiceBase.FromJson <HR_STATION_LEVEL>(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<HR_STATION_LEVEL>(hidCondition.Value);
     }
     BindList(condObj, aspPager.CurrentPageIndex);
 }
示例#6
0
 protected void btnSetPageSize_Click(object sender, EventArgs e)
 {
     aspPager.PageSize = int.Parse(txtPageSize.Value);
     if (hidCondition.Value != "")
     {
         condObj = JsonServiceBase.FromJson <HR_STATION_LEVEL>(hidCondition.Value);
     }
     BindList(condObj, aspPager.CurrentPageIndex);
 }
    protected void Page_Load(object sender, EventArgs e)
    {
        #region//默认隐藏的列
        //hideTableColumnList = new List<AttributeItem>();
        //hideTableColumnList.Add(HR_STATION_LEVEL.Attribute.EXP1);
        //hideTableColumnList.Add(HR_STATION_LEVEL.Attribute.EXP2);
        //hideTableColumnList.Add(HR_STATION_LEVEL.Attribute.EXP3);
        //valObj.LoadAllAttributes(true);//暂时加此代码,以后框架更新将不需要
        //valObj.Remove(hideTableColumnList);

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

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

            if (!string.IsNullOrEmpty(Request["ids"]))
            {
                HR_STATION_LEVEL roleOld = new HR_STATION_LEVEL();
                roleOld.Where(HR_STATION_LEVEL.Attribute.LEVEL_ID, Request["ids"].ToString());
                listObj = BLLTable <HR_STATION_LEVEL> .Select(valObj, roleOld);

                for (int i = 0; i < listObj.Count; i++)
                {
                    if (i > 0)
                    {
                        hidOld.Value     += ",";
                        hidInitIDS.Value += ",";
                    }
                    hidOld.Value     += "{ID:'" + listObj[i].LEVEL_ID + "',Name:'" + listObj[i].LEVEL_ID + "'}";//这里的Name用于显示在列表中,请自行重定义。
                    hidInitIDS.Value += listObj[i].LEVEL_ID;
                }
            }
            try
            {
                listObj = BLLTable <HR_STATION_LEVEL> .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["DelLEVEL_ID"] != null)
        {
            int re = BLLTable <HR_STATION_LEVEL> .Delete(HR_STATION_LEVEL.Attribute.LEVEL_ID, Request["DelLEVEL_ID"]);

            if (re > 0)
            {
                Response.Write("1");//可以输出数字 大于0 表示操作成功,也可以直接输出 字符串,客户端将弹出此字符串信息作为提示
            }
            else
            {
                Response.Write("删除失败!");
            }
        }

        //在列表顶部点击删除按钮,通过AJAX执行这里的后台代码,删除多条记录
        if (Request["DelKeyIDS"] != null)
        {
            HR_STATION_LEVEL cond = new HR_STATION_LEVEL();
            cond.In(HR_STATION_LEVEL.Attribute.LEVEL_ID, Request["DelKeyIDS"]);
            int re = BLLTable <HR_STATION_LEVEL> .Delete(cond);

            if (re > 0)
            {
                Response.Write("1");//可以输出数字 大于0 表示操作成功,也可以直接输出 字符串,客户端将弹出此字符串信息作为提示
            }
            else
            {
                Response.Write("删除失败!");
            }
        }

        //在用户详细信息查看编辑页面,点保存时,通过AJAX执行这里的后台代码,实现部门字段的更新
        if (Request["saveInfo"] != null)
        {
            HR_STATION_LEVEL val = new HR_STATION_LEVEL();
            val.LEVEL_ID = 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 <HR_STATION_LEVEL> .Update(val, HR_STATION_LEVEL.Attribute.LEVEL_ID);

            Response.Write("修改用户信息成功");
        }
        Response.End();
    }
    protected void Page_Load(object sender, EventArgs e)
    {
        //���б�����ɾ����ť��ͨ��AJAXִ������ĺ�̨���룬ɾ��һ����¼
        if (Request["DelLEVEL_ID"] != null)
        {
            int re = BLLTable<HR_STATION_LEVEL>.Delete(HR_STATION_LEVEL.Attribute.LEVEL_ID, Request["DelLEVEL_ID"]);
            if (re > 0)
            {
                Response.Write("1");//����������� ����0 ��ʾ�����ɹ���Ҳ����ֱ����� �ַ������ͻ��˽��������ַ�����Ϣ��Ϊ��ʾ
            }
            else
            {
                Response.Write("ɾ��ʧ�ܣ�");
            }
        }

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

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

        }
        Response.End();
    }
示例#10
0
    protected void Page_Load(object sender, EventArgs e)
    {
        title      = valObj._ZhName + "详细";
        Page.Title = title;
        if (!IsPostBack)
        {
            try
            {
                if (!string.IsNullOrEmpty(Request["LEVEL_ID"]))
                {
                    valObj = BLLTable <HR_STATION_LEVEL> .GetRowData(HR_STATION_LEVEL.Attribute.LEVEL_ID, Request["LEVEL_ID"]);

                    if (valObj == null)
                    {
                        return;
                    }


                    txtLEVEL_ID.Text = Convert.ToString(valObj.LEVEL_ID);//Convert.ToDecimal


                    txtLEVEL_NAME.Text = Convert.ToString(valObj.LEVEL_NAME);//Convert.ToString


                    txtADDTIME.Text = (valObj.ADDTIME == DateTime.MinValue) ? "" : valObj.ADDTIME.ToString("yyyy-MM-dd HH:mm");
                }
            }
            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 btnFind_Click(object sender, EventArgs e)
    {
        condObj = new HR_STATION_LEVEL();

        if(txtLEVEL_ID.Value !="" )
            condObj.Like(HR_STATION_LEVEL.Attribute.LEVEL_ID, Convert.ToDecimal(txtLEVEL_ID.Value));

        if(txtLEVEL_NAME.Value !="" )
            condObj.Like(HR_STATION_LEVEL.Attribute.LEVEL_NAME, Convert.ToString(txtLEVEL_NAME.Value));

        if(txtADDTIME.Value !="" )
            condObj.Like(HR_STATION_LEVEL.Attribute.ADDTIME, Convert.ToDateTime(txtADDTIME.Value));

        hidCondition.Value = condObj.ToJson(20);

        BindList(condObj, 1);
    }
    protected void Page_Load(object sender, EventArgs e)
    {
        title = valObj._ZhName + "��ϸ";
        Page.Title = title;
        if (!IsPostBack)
        {
            try
            {
                if (!string.IsNullOrEmpty(Request["LEVEL_ID"]))
                {

                    valObj = BLLTable<HR_STATION_LEVEL>.GetRowData(HR_STATION_LEVEL.Attribute.LEVEL_ID, Request["LEVEL_ID"]);
                    if(valObj==null) return ;

                    txtLEVEL_ID.Text = Convert.ToString(valObj.LEVEL_ID);//Convert.ToDecimal

                    txtLEVEL_NAME.Text = Convert.ToString(valObj.LEVEL_NAME);//Convert.ToString

                    txtADDTIME.Text = (valObj.ADDTIME == DateTime.MinValue) ? "" : valObj.ADDTIME.ToString("yyyy-MM-dd HH:mm");

                }
            }
            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();
            }
        }
    }
示例#13
0
    private void BindList(HR_STATION condObj, int curPage)
    {
        if (condObj.af_PageByAttributeItem == null)//如果不存在用户定义的分页排序属性,则用主键属性排序
        {
            condObj.af_PageBy(HR_STATION.Attribute.STATION_ID, Order.Asc);
        }

        #region//数据权限条件

        #endregion
        //condObj.PID = decimal.Parse(pid);
        if (org != "")
        {
            condObj.DEPT_ID = "0";
            condObj.ORG_ID  = org;
        }
        if (dept != "")
        {
            condObj.DEPT_ID = dept;
        }

        Relation r1 = new Relation(HR_STATION.Attribute.LEVEL_ID, HR_STATION_LEVEL.Attribute.LEVEL_ID);
        Relation r2 = new Relation(HR_STATION.Attribute.TYPE_ID, HR_STATION_TYPE.Attribute.TYPE_ID);

        List <Relation> lstRelatio = new List <Relation>();
        lstRelatio.Add(r1);
        lstRelatio.Add(r2);

        HR_STATION_TYPE valType = new HR_STATION_TYPE();
        valType.TYPE_NAME = "";
        HR_STATION_LEVEL valLevel = new HR_STATION_LEVEL();
        valLevel.LEVEL_NAME = "";
        List <ITableImplement> lstTable = new List <ITableImplement>();
        lstTable.Add(valType);
        lstTable.Add(valLevel);

        List <ITableImplement> lstCond = new List <ITableImplement>();
        lstCond.Add(condObj);

        List <HR_STATION> listObj = BLLTable <HR_STATION> .Factory(conn).Select(valObj, lstRelatio, lstTable, lstCond);

        repList.DataSource = listObj;
        repList.DataBind();
        aspPager.RecordCount = recount;
    }
 protected void aspPager_PageChanged(object sender, EventArgs e)
 {
     try
     {
         recount = aspPager.RecordCount;
         if (hidCondition.Value != "")
         {
             condObj = JsonServiceBase.FromJson<HR_STATION_LEVEL>(hidCondition.Value);
         }
         List<HR_STATION_LEVEL> listVal = BLLTable<HR_STATION_LEVEL>.SelectByPage(valObj, condObj, aspPager.PageSize, aspPager.CurrentPageIndex, ref recount);
         repList.DataSource = listVal;
         repList.DataBind();
     }
     catch (Exception ex)
     {
          litWarn.Text = ex.Message;
     }
 }
示例#15
0
    private void BindList(HR_STATION_LEVEL condObj, int curPage)
    {
        if (condObj.af_PageByAttributeItem == null)//如果不存在用户定义的分页排序属性,则用主键属性排序
        {
            condObj.af_PageBy(HR_STATION_LEVEL.Attribute.LEVEL_ID, Order.Desc);
        }

        #region//数据权限条件

        #endregion
        //condObj.PID = decimal.Parse(pid);

        listObj = BLLTable <HR_STATION_LEVEL> .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 <HR_STATION_LEVEL>(hidCondition.Value);
            }
            listObj = BLLTable <HR_STATION_LEVEL> .SelectByPage(valObj, condObj, aspPager.PageSize, aspPager.CurrentPageIndex, ref recount);

            repCus.DataSource = listObj;
            repCus.DataBind();
        }
        catch (Exception ex)
        {
            litWarn.Text = ex.Message;
        }
    }
示例#17
0
    protected void Page_Load(object sender, EventArgs e)
    {
        title      = valObj._ZhName + "±à¼­";
        Page.Title = title;
        if (!string.IsNullOrEmpty(Request["LEVEL_ID"]))
        {
            keyid = Request["LEVEL_ID"];
        }

        if (!string.IsNullOrEmpty(Request["KeyID"]))
        {
            keyid = Request["KeyID"];
        }
        if (!IsPostBack)
        {
            txtADDTIME.Value = (DateTime.Now).ToString("yyyy-MM-dd");

            this.txtLEVEL_ID.Disabled            = true; this.txtLEVEL_ID.Value = "0";
            this.txtLEVEL_ID.Attributes["class"] = "dis";
            try
            {
                if (keyid != "")
                {
                    valObj = BLLTable <HR_STATION_LEVEL> .GetRowData(HR_STATION_LEVEL.Attribute.LEVEL_ID, keyid);

                    if (valObj == null)
                    {
                        return;
                    }


                    txtLEVEL_ID.Value = Convert.ToString(valObj.LEVEL_ID);     //Convert.ToDecimal

                    txtLEVEL_NAME.Value = Convert.ToString(valObj.LEVEL_NAME); //Convert.ToString

                    txtADDTIME.Value = (valObj.ADDTIME == DateTime.MinValue) ? "" : valObj.ADDTIME.ToString("yyyy-MM-dd");
                }
            }
            catch (Exception ex)
            {
                litWarn.Text = ex.Message;
            }
        }
    }
    protected void btnFind_Click(object sender, EventArgs e)
    {
        condObj = new HR_STATION_LEVEL();


        if (txtLEVEL_ID.Value != "")
        {
            condObj.Like_OR(HR_STATION_LEVEL.Attribute.LEVEL_ID, Convert.ToDecimal(txtLEVEL_ID.Value));
        }


        if (txtLEVEL_NAME.Value != "")
        {
            condObj.Like_OR(HR_STATION_LEVEL.Attribute.LEVEL_NAME, Convert.ToString(txtLEVEL_NAME.Value));
        }


        if (txtADDTIME.Value != "")
        {
            condObj.Like_OR(HR_STATION_LEVEL.Attribute.ADDTIME, Convert.ToDateTime(txtADDTIME.Value));
        }

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

            listObj = BLLTable <HR_STATION_LEVEL> .SelectByPage(valObj, condObj, aspPager.PageSize, 1, ref recount);

            repList.DataSource = listObj;
            repList.DataBind();
        }
        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["LEVEL_ID"]))
        {
            keyid = Request["LEVEL_ID"];
        }

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

            txtADDTIME.Value = (DateTime.Now).ToString("yyyy-MM-dd");

            this.txtLEVEL_ID.Disabled = true; this.txtLEVEL_ID.Value = "0";
            this.txtLEVEL_ID.Attributes["class"] = "dis";
            try
            {
                if (keyid != "")
                {
                    valObj = BLLTable<HR_STATION_LEVEL>.GetRowData(HR_STATION_LEVEL.Attribute.LEVEL_ID, keyid);
                    if(valObj==null) return ;

                    txtLEVEL_ID.Value = Convert.ToString(valObj.LEVEL_ID);//Convert.ToDecimal

                    txtLEVEL_NAME.Value = Convert.ToString(valObj.LEVEL_NAME);//Convert.ToString

                    txtADDTIME.Value = (valObj.ADDTIME == DateTime.MinValue) ? "" : valObj.ADDTIME.ToString("yyyy-MM-dd");
                }
            }
            catch (Exception ex)
            {
                litWarn.Text = ex.Message;
            }
        }
    }
示例#20
0
    private void BindList(HR_STATION condObj, int curPage)
    {
        if (condObj.af_PageByAttributeItem == null)//����������û�����ķ�ҳ�������ԣ�����������������
            condObj.af_PageBy(HR_STATION.Attribute.STATION_ID, Order.Asc);

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

        #endregion
        //condObj.PID = decimal.Parse(pid);
        if (org != "")
        {
            condObj.DEPT_ID = "0";
            condObj.ORG_ID = org;

        } if (dept != "")
        {
            condObj.DEPT_ID = dept;

        }

        Relation r1 = new Relation(HR_STATION.Attribute.LEVEL_ID, HR_STATION_LEVEL.Attribute.LEVEL_ID);
        Relation r2 = new Relation(HR_STATION.Attribute.TYPE_ID, HR_STATION_TYPE.Attribute.TYPE_ID);

        List<Relation> lstRelatio = new List<Relation>();
        lstRelatio.Add(r1);
        lstRelatio.Add(r2);

        HR_STATION_TYPE valType = new HR_STATION_TYPE();
        valType.TYPE_NAME = "";
        HR_STATION_LEVEL valLevel = new HR_STATION_LEVEL();
        valLevel.LEVEL_NAME = "";
        List<ITableImplement> lstTable = new List<ITableImplement>();
        lstTable.Add(valType);
        lstTable.Add(valLevel);

        List<ITableImplement> lstCond = new List<ITableImplement>();
        lstCond.Add(condObj);

        List<HR_STATION> listObj = BLLTable<HR_STATION>.Factory(conn).Select(valObj, lstRelatio, lstTable, lstCond);

        repList.DataSource = listObj;
        repList.DataBind();
        aspPager.RecordCount = recount;
    }
示例#21
0
    private void BindList(HR_STAFF condObj, int curPage)
    {
        if (valObj.af_PageByAttributeItem == null)//如果不存在用户定义的分页排序属性,则用主键属性排序
        {
            valObj.af_PageBy(HR_STAFF.Attribute.STAFF_ID, Order.Desc);
        }

        if (deptid != "")
        {
            condDep.DEPT_ID = deptid;
            //Response.Write(deptid);
        }
        else
        {
            condDep.Where("HR_DEPT_STAFF.DEPT_ID = '' or HR_DEPT_STAFF.DEPT_ID is null");
        }
        //condObj.PID = decimal.Parse(pid);

        valObj.LoadAllAttributes(false);
        showTableColumnList.Add(HR_STAFF.Attribute.PATH);
        showTableColumnList.Add(HR_STAFF.Attribute.PNAME);
        showTableColumnList.Add(HR_STAFF.Attribute.GENDER);
        valObj.Add(showTableColumnList.ToArray());

        Relation rel = new Relation(HR_STAFF.Attribute.STAFF_ID, HR_DEPT_STAFF.Attribute.STAFF_ID);
        List <ITableImplement> lst = new List <ITableImplement>();

        lst.Add(condDep);
        lst.Add(condObj);

        listObj = BLLTable <HR_STAFF> .Factory(conn).SelectByPage(valObj, rel, new HR_DEPT_STAFF(), lst, aspPager.PageSize, curPage, ref recount);

        repList.DataSource = listObj;
        repList.DataBind();
        aspPager.RecordCount = recount;

        //部门领导
        HR_DEPT_MANAGER valObj2  = new HR_DEPT_MANAGER();
        HR_DEPT_MANAGER condObj2 = new HR_DEPT_MANAGER();

        valObj2.Top(1);
        condObj2.DEPT_ID = deptid;
        List <HR_DEPT_MANAGER> listObj2 = BLLTable <HR_DEPT_MANAGER> .Factory(conn).Select(valObj2, condObj2);

        repList_DEPT_MANAGER.DataSource = listObj2;
        repList_DEPT_MANAGER.DataBind();

        //岗位信息
        HR_STATION valObj3  = new HR_STATION();
        HR_STATION condObj3 = new HR_STATION();
        Relation   r1       = new Relation(HR_STATION.Attribute.LEVEL_ID, HR_STATION_LEVEL.Attribute.LEVEL_ID);
        Relation   r2       = new Relation(HR_STATION.Attribute.TYPE_ID, HR_STATION_TYPE.Attribute.TYPE_ID);

        List <Relation> lstRelatio = new List <Relation>();

        lstRelatio.Add(r1);
        lstRelatio.Add(r2);

        HR_STATION_TYPE valType = new HR_STATION_TYPE();

        valType.TYPE_NAME = "";
        HR_STATION_LEVEL valLevel = new HR_STATION_LEVEL();

        valLevel.LEVEL_NAME = "";
        List <ITableImplement> lstTable = new List <ITableImplement>();

        lstTable.Add(valType);
        lstTable.Add(valLevel);

        condObj3.DEPT_ID = deptid;

        List <ITableImplement> lstCond = new List <ITableImplement>();

        lstCond.Add(condObj3);

        List <HR_STATION> listObj3 = BLLTable <HR_STATION> .Factory(conn).Select(valObj3, lstRelatio, lstTable, lstCond);

        repList_HR_STATION.DataSource = listObj3;
        repList_HR_STATION.DataBind();
    }
示例#22
0
    protected void btnOK_Click(object sender, EventArgs e)
    {
        try
        {
            HR_STATION_LEVEL valObj = new HR_STATION_LEVEL();


            if (txtLEVEL_ID.Value != "")
            {
                valObj.LEVEL_ID = Convert.ToDecimal(txtLEVEL_ID.Value);
            }


            if (txtLEVEL_NAME.Value != "")
            {
                valObj.LEVEL_NAME = Convert.ToString(txtLEVEL_NAME.Value);
            }


            if (txtADDTIME.Value != "")
            {
                valObj.ADDTIME = Convert.ToDateTime(txtADDTIME.Value);
            }

            if (keyid != "")
            {
                valObj.LEVEL_ID = Convert.ToDecimal(keyid);
                count           = BLLTable <HR_STATION_LEVEL> .Update(valObj, HR_STATION_LEVEL.Attribute.LEVEL_ID);
            }
            else
            {
                count = BLLTable <HR_STATION_LEVEL> .Insert(valObj, HR_STATION_LEVEL.Attribute.LEVEL_ID);

                keyid = valObj.LEVEL_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
                {
                    txtLEVEL_ID.Value = "";


                    txtLEVEL_NAME.Value = "";


                    txtADDTIME.Value = "";
                }
            }
        }
        catch (Exception ex)
        {
            litWarn.Text = ex.Message;
        }
    }
    protected void Page_Load(object sender, EventArgs e)
    {
        #region//Ĭ�����ص���
        //hideTableColumnList = new List<AttributeItem>();
        //hideTableColumnList.Add(HR_STATION_LEVEL.Attribute.EXP1);
        //hideTableColumnList.Add(HR_STATION_LEVEL.Attribute.EXP2);
        //hideTableColumnList.Add(HR_STATION_LEVEL.Attribute.EXP3);
        //valObj.LoadAllAttributes(true);//��ʱ�Ӵ˴��룬�Ժ��ܸ��½�����Ҫ
        //valObj.Remove(hideTableColumnList);

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

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

            if (!string.IsNullOrEmpty(Request["ids"]))
            {
                HR_STATION_LEVEL roleOld = new HR_STATION_LEVEL();
                roleOld.Where(HR_STATION_LEVEL.Attribute.LEVEL_ID, Request["ids"].ToString());
                listObj = BLLTable<HR_STATION_LEVEL>.Select(valObj, roleOld);
                for (int i = 0; i < listObj.Count; i++)
                {
                    if (i > 0)
                    {
                        hidOld.Value += ",";
                        hidInitIDS.Value += ",";
                    }
                    hidOld.Value += "{ID:'" + listObj[i].LEVEL_ID + "',Name:'" + listObj[i].LEVEL_ID + "'}";//�����Name������ʾ���б��У��������ض��塣
                    hidInitIDS.Value += listObj[i].LEVEL_ID;
                }
            }
            try
            {

                listObj = BLLTable<HR_STATION_LEVEL>.SelectByPage(valObj, condObj, aspPager.PageSize, 1, ref recount);
                repList.DataSource = listObj;
                repList.DataBind();
                aspPager.RecordCount = recount;
            }
            catch (Exception ex)
            {
                 litWarn.Text = ex.Message;
            }

        }
    }
示例#24
0
    private void BindList(HR_STAFF condObj, int curPage)
    {
        if (valObj.af_PageByAttributeItem == null)//����������û�����ķ�ҳ�������ԣ�����������������
            valObj.af_PageBy(HR_STAFF.Attribute.STAFF_ID, Order.Desc);

        if (deptid != "")
        {
            condDep.DEPT_ID = deptid;
            //Response.Write(deptid);
        }
        else
        {
            condDep.Where("HR_DEPT_STAFF.DEPT_ID = '' or HR_DEPT_STAFF.DEPT_ID is null");
        }
        //condObj.PID = decimal.Parse(pid);

        valObj.LoadAllAttributes(false);
        showTableColumnList.Add(HR_STAFF.Attribute.PATH);
        showTableColumnList.Add(HR_STAFF.Attribute.PNAME);
        showTableColumnList.Add(HR_STAFF.Attribute.GENDER);
        valObj.Add(showTableColumnList.ToArray());

        Relation rel = new Relation(HR_STAFF.Attribute.STAFF_ID, HR_DEPT_STAFF.Attribute.STAFF_ID);
        List<ITableImplement> lst = new List<ITableImplement>();
        lst.Add(condDep);
        lst.Add(condObj);

        listObj = BLLTable<HR_STAFF>.Factory(conn).SelectByPage(valObj, rel, new HR_DEPT_STAFF(), lst, aspPager.PageSize, curPage, ref recount);
        repList.DataSource = listObj;
        repList.DataBind();
        aspPager.RecordCount = recount;

        //�����쵼
        HR_DEPT_MANAGER valObj2 = new HR_DEPT_MANAGER();
        HR_DEPT_MANAGER condObj2 = new HR_DEPT_MANAGER();
        valObj2.Top(1);
        condObj2.DEPT_ID = deptid;
        List<HR_DEPT_MANAGER> listObj2 = BLLTable<HR_DEPT_MANAGER>.Factory(conn).Select(valObj2, condObj2);
        repList_DEPT_MANAGER.DataSource = listObj2;
        repList_DEPT_MANAGER.DataBind();

        //��λ��Ϣ
        HR_STATION valObj3 = new HR_STATION();
        HR_STATION condObj3 = new HR_STATION();
        Relation r1 = new Relation(HR_STATION.Attribute.LEVEL_ID,HR_STATION_LEVEL.Attribute.LEVEL_ID);
        Relation r2 = new Relation(HR_STATION.Attribute.TYPE_ID, HR_STATION_TYPE.Attribute.TYPE_ID);

        List<Relation> lstRelatio=new List<Relation>();
        lstRelatio.Add(r1);
        lstRelatio.Add(r2);

        HR_STATION_TYPE valType = new HR_STATION_TYPE();
        valType.TYPE_NAME = "";
        HR_STATION_LEVEL valLevel = new HR_STATION_LEVEL();
        valLevel.LEVEL_NAME = "";
        List<ITableImplement> lstTable = new List<ITableImplement>();
        lstTable.Add(valType);
        lstTable.Add(valLevel);

        condObj3.DEPT_ID = deptid;

        List<ITableImplement> lstCond = new List<ITableImplement>();
        lstCond.Add(condObj3);

        List<HR_STATION> listObj3 = BLLTable<HR_STATION>.Factory(conn).Select(valObj3, lstRelatio, lstTable, lstCond);
        repList_HR_STATION.DataSource = listObj3;
        repList_HR_STATION.DataBind();
    }
    protected void btnOK_Click(object sender, EventArgs e)
    {
        try
        {
            HR_STATION_LEVEL valObj = new HR_STATION_LEVEL();

            if(txtLEVEL_ID.Value !="" )
                valObj.LEVEL_ID = Convert.ToDecimal(txtLEVEL_ID.Value);

            if(txtLEVEL_NAME.Value !="" )
                valObj.LEVEL_NAME = Convert.ToString(txtLEVEL_NAME.Value);

            if(txtADDTIME.Value !="" )
                valObj.ADDTIME = Convert.ToDateTime(txtADDTIME.Value);

            if (keyid != "")
            {
                valObj.LEVEL_ID = Convert.ToDecimal(keyid);
                count = BLLTable<HR_STATION_LEVEL>.Update(valObj, HR_STATION_LEVEL.Attribute.LEVEL_ID);
            }
            else
            {
                count = BLLTable<HR_STATION_LEVEL>.Insert(valObj, HR_STATION_LEVEL.Attribute.LEVEL_ID);
                keyid = valObj.LEVEL_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
                {

                    txtLEVEL_ID.Value ="";

                    txtLEVEL_NAME.Value ="";

                    txtADDTIME.Value ="";
                }
            }
        }
        catch (Exception ex)
        {
            litWarn.Text = ex.Message;
        }
    }
    private void BindList(HR_STATION_LEVEL condObj, int curPage)
    {
        if (condObj.af_PageByAttributeItem == null)//����������û�����ķ�ҳ�������ԣ�����������������
            condObj.af_PageBy(HR_STATION_LEVEL.Attribute.LEVEL_ID, Order.Desc);

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

        #endregion
        //condObj.PID = decimal.Parse(pid);

        listObj = BLLTable<HR_STATION_LEVEL>.SelectByPage(valObj, condObj, aspPager.PageSize, curPage, ref recount);
        repList.DataSource = listObj;
        repList.DataBind();
        aspPager.RecordCount = recount;
    }