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

        if(txtDeviceID.Value !="" )
            condObj.Like_OR(HR_CHECKWORKDEVICE.Attribute.DeviceID, Convert.ToString(txtDeviceID.Value));

        if(txtORG_ID.Value !="" )
            condObj.Like_OR(HR_CHECKWORKDEVICE.Attribute.ORG_ID, Convert.ToString(txtORG_ID.Value));

        if(txtUSE_FLAG.Value !="" )
            condObj.USE_FLAG = Convert.ToString(txtUSE_FLAG.Value);

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

            listObj = BLLTable<HR_CHECKWORKDEVICE>.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 HR_CHECKWORKDEVICE();



        if (txtDeviceID.Value != "")
        {
            condObj.Like(HR_CHECKWORKDEVICE.Attribute.DeviceID, Convert.ToString(txtDeviceID.Value));
        }

        if (txtDeviceName.Value != "")
        {
            condObj.Like(HR_CHECKWORKDEVICE.Attribute.DeviceName, Convert.ToString(txtDeviceName.Value));
        }


        if (!string.IsNullOrEmpty(wucSelORG1.ORG_ID) && !string.IsNullOrEmpty(wucSelORG1.ORG_NAME))
        {
            condObj.ORG_ID = wucSelORG1.ORG_ID;
        }


        if (txtUSE_FLAG.Value != "")
        {
            condObj.USE_FLAG = Convert.ToString(txtUSE_FLAG.Value);
        }

        hidCondition.Value = condObj.ToJson(20);

        BindList(condObj, 1);
    }
    private void GetOtherOrg(ref int deptCount, ref int staffCount, ref string msg)
    {
        deptCount  = 0;
        staffCount = 0;
        msg        = "";
        if (string.IsNullOrEmpty(hidCondition.Value))
        {
            return;
        }
        string[]           deviceIds = hidCondition.Value.Split(',');
        HR_CHECKWORKDEVICE con       = new HR_CHECKWORKDEVICE();

        con.In(HR_CHECKWORKDEVICE.Attribute.DeviceID, deviceIds);
        List <HR_CHECKWORKDEVICE> devList = BLLTable <HR_CHECKWORKDEVICE> .Factory(conn).Select(new HR_CHECKWORKDEVICE(), con);

        if (devList.Count < 1)
        {
            return;
        }
        List <DeviceOrg> orgList = new List <DeviceOrg>();

        msg += "<div class='maskmsgtool' style='width:500px; height:20px;'><a onclick=\"$('.main').unmask();\">关闭</a></div>";
        msg += "<div class='msgtblist' style='width:500px;'>";
        msg += "<table style='width:100%;'>";
        msg += "    <thead>";
        msg += "        <tr>";
        msg += "            <td colspan='4' style='width:500px;'>详细信息</td>";
        msg += "        </tr>";
        msg += "        <tr>";
        msg += "            <td style='width:60px;'>设备ID</td>";
        msg += "            <td style='width:180px;'>设备名</td>";
        msg += "            <td style='width:160px;'>部门表(新增/总数)</td>";
        msg += "            <td style='width:160px;'>员工表(新增/总数)</td>";
        msg += "        </tr>";
        msg += "    </thead>";
        msg += "    <tbody>";
        foreach (HR_CHECKWORKDEVICE dev in devList)
        {
            msg += "        <tr>";
            msg += "            <td class='first''>" + dev.DeviceID + "</td>";
            msg += "            <td>" + dev.DeviceName + "</td>";
            DeviceOrg devOrg = null;
            GetOtherOrg(dev, ref devOrg);
            orgList.Add(devOrg);
            msg += "            <td>" + devOrg.deptMsg + "</td>";
            msg += "            <td>" + devOrg.staffMsg + "</td>";
            msg += "        </tr>";
        }
        msg += "    </tbody>";
        RemoveRepeatAndInsertAioByName(orgList, ref deptCount, ref staffCount);
        msg += "    <tbody>";
        msg += "        <tr style='background:#eee;'>";
        msg += "            <td colspan='2' style='text-align:right;'>根据部门/员工名称去重后获取记录数:</td>";
        msg += "            <td>" + staffCount + "</td>";
        msg += "            <td>" + deptCount + "</td>";
        msg += "        </tr>";
        msg += "    </tbody>";
        msg += "</table>";
        msg += "</div>";
    }
 protected void aspPager_PageChanged(object sender, EventArgs e)
 {
     if (hidCondition.Value != "")
     {
         condObj = JsonServiceBase.FromJson <HR_CHECKWORKDEVICE>(hidCondition.Value);
     }
     BindList(condObj, aspPager.CurrentPageIndex);
 }
 protected void aspPager_PageChanged(object sender, EventArgs e)
 {
     if (hidCondition.Value != "")
     {
         condObj = JsonServiceBase.FromJson<HR_CHECKWORKDEVICE>(hidCondition.Value);
     }
     BindList(condObj, aspPager.CurrentPageIndex);
 }
 private void GetOtherOrg(HR_CHECKWORKDEVICE dev, ref DeviceOrg devOrg)
 {
     devOrg = new DeviceOrg(dev);
     if (!devOrg.enable)
     {
         return;
     }
 }
 protected void btnSetPageSize_Click(object sender, EventArgs e)
 {
     aspPager.PageSize = int.Parse(txtPageSize.Value);
     if (hidCondition.Value != "")
     {
         condObj = JsonServiceBase.FromJson <HR_CHECKWORKDEVICE>(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_CHECKWORKDEVICE>(hidCondition.Value);
     }
     BindList(condObj, aspPager.CurrentPageIndex);
 }
    protected void Page_Load(object sender, EventArgs e)
    {
        //在列表里点击删除按钮,通过AJAX执行这里的后台代码,删除一条记录
        if (Request["DelDeviceID"] != null)
        {
            int re = BLLTable <HR_CHECKWORKDEVICE> .Factory(conn).Delete(HR_CHECKWORKDEVICE.Attribute.DeviceID, Request["DelDeviceID"]);

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

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

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

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

            Response.Write("修改用户信息成功");
        }
        Response.End();
    }
Beispiel #10
0
    protected void Page_Load(object sender, EventArgs e)
    {
        #region//默认隐藏的列
        //hideTableColumnList = new List<AttributeItem>();
        //hideTableColumnList.Add(HR_CHECKWORKDEVICE.Attribute.EXP1);
        //hideTableColumnList.Add(HR_CHECKWORKDEVICE.Attribute.EXP2);
        //hideTableColumnList.Add(HR_CHECKWORKDEVICE.Attribute.EXP3);
        //valObj.LoadAllAttributes(true);//暂时加此代码,以后框架更新将不需要
        //valObj.Remove(hideTableColumnList);

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

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

            if (!string.IsNullOrEmpty(Request["ids"]))
            {
                HR_CHECKWORKDEVICE roleOld = new HR_CHECKWORKDEVICE();
                roleOld.Where(HR_CHECKWORKDEVICE.Attribute.DeviceID, Request["ids"].ToString());
                listObj = BLLTable <HR_CHECKWORKDEVICE> .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].DeviceID + "',Name:'" + listObj[i].DeviceID + "'}";//这里的Name用于显示在列表中,请自行重定义。
                    hidInitIDS.Value += listObj[i].DeviceID;
                }
            }
            try
            {
                listObj = BLLTable <HR_CHECKWORKDEVICE> .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["DelDeviceID"] != null)
        {
            int re = BLLTable<HR_CHECKWORKDEVICE>.Factory(conn).Delete(HR_CHECKWORKDEVICE.Attribute.DeviceID, Request["DelDeviceID"]);
            if (re > 0)
            {
                Response.Write("1");//����������� ����0 ��ʾ�����ɹ���Ҳ����ֱ����� �ַ������ͻ��˽��������ַ�����Ϣ��Ϊ��ʾ
            }
            else
            {
                Response.Write("ɾ��ʧ�ܣ�");
            }
        }

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

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

        }
        Response.End();
    }
Beispiel #12
0
    protected void Page_Load(object sender, EventArgs e)
    {
        title      = "设备详细";
        Page.Title = title;
        if (!IsPostBack)
        {
            try
            {
                if (!string.IsNullOrEmpty(Request["DeviceID"]))
                {
                    valObj = BLLTable <HR_CHECKWORKDEVICE> .Factory(conn).GetRowData(HR_CHECKWORKDEVICE.Attribute.DeviceID, Request["DeviceID"]);

                    if (valObj == null)
                    {
                        return;
                    }


                    txtDeviceID.Text = Convert.ToString(valObj.DeviceID);//Convert.ToString


                    txtORG_ID.Text = Convert.ToString(valObj.ORG_ID);//Convert.ToString


                    txtUSE_FLAG.Text = valObj.USE_FLAG.ToString();
                }
            }
            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 = "�豸��ϸ";
        Page.Title = title;
        if (!IsPostBack)
        {
            try
            {
                if (!string.IsNullOrEmpty(Request["DeviceID"]))
                {

                    valObj = BLLTable<HR_CHECKWORKDEVICE>.Factory(conn).GetRowData(HR_CHECKWORKDEVICE.Attribute.DeviceID, Request["DeviceID"]);
                    if(valObj==null) return ;

                    txtDeviceID.Text = Convert.ToString(valObj.DeviceID);//Convert.ToString

                    txtORG_ID.Text = Convert.ToString(valObj.ORG_ID);//Convert.ToString

                    txtUSE_FLAG.Text=valObj.USE_FLAG.ToString();

                }
            }
            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 aspPager_PageChanged(object sender, EventArgs e)
 {
     try
     {
         recount = aspPager.RecordCount;
         if (hidCondition.Value != "")
         {
             condObj = JsonServiceBase.FromJson<HR_CHECKWORKDEVICE>(hidCondition.Value);
         }
         List<HR_CHECKWORKDEVICE> listVal = BLLTable<HR_CHECKWORKDEVICE>.Factory(conn).SelectByPage(valObj, condObj, aspPager.PageSize, aspPager.CurrentPageIndex, ref recount);
         repList.DataSource = listVal;
         repList.DataBind();
     }
     catch (Exception ex)
     {
          litWarn.Text = ex.Message;
     }
 }
Beispiel #15
0
    protected void aspPager_PageChanged(object sender, EventArgs e)
    {
        try
        {
            if (hidCondition.Value != "")
            {
                condObj = JsonServiceBase.FromJson <HR_CHECKWORKDEVICE>(hidCondition.Value);
            }
            listObj = BLLTable <HR_CHECKWORKDEVICE> .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 HR_CHECKWORKDEVICE();

        if(txtDeviceID.Value !="" )
            condObj.Like(HR_CHECKWORKDEVICE.Attribute.DeviceID, Convert.ToString(txtDeviceID.Value));

        if (txtDeviceName.Value != "")
            condObj.Like(HR_CHECKWORKDEVICE.Attribute.DeviceName, Convert.ToString(txtDeviceName.Value));

        if (!string.IsNullOrEmpty(wucSelORG1.ORG_ID) && !string.IsNullOrEmpty(wucSelORG1.ORG_NAME))
            condObj.ORG_ID = wucSelORG1.ORG_ID;

        if(txtUSE_FLAG.Value !="" )
            condObj.USE_FLAG = Convert.ToString(txtUSE_FLAG.Value);

        hidCondition.Value = condObj.ToJson(20);

        BindList(condObj, 1);
    }
    private void BindList(HR_CHECKWORKDEVICE condObj, int curPage)
    {
        if (condObj.af_PageByAttributeItem == null)//如果不存在用户定义的分页排序属性,则用主键属性排序
        {
            condObj.af_PageBy(HR_CHECKWORKDEVICE.Attribute.DeviceID, Order.Desc);
        }

        #region//数据权限条件

        #endregion
        //condObj.PID = decimal.Parse(pid);
        HR_ORG orgVal = new HR_ORG();
        orgVal._ORG_NAME = "";
        Relation rt = new Relation(HR_CHECKWORKDEVICE.Attribute.ORG_ID, HR_ORG.Attribute.ORG_ID);

        listObj = BLLTable <HR_CHECKWORKDEVICE> .Factory(conn).SelectByPage(valObj, rt, orgVal, condObj, aspPager.PageSize, curPage, ref recount);

        repList.DataSource = listObj;
        repList.DataBind();
        aspPager.RecordCount = recount;
    }
Beispiel #18
0
    protected void btnFind_Click(object sender, EventArgs e)
    {
        try
        {
            condObj = new HR_CHECKWORKDEVICE();



            if (txtDeviceID.Value != "")
            {
                condObj.Like(HR_CHECKWORKDEVICE.Attribute.DeviceID, Convert.ToString(txtDeviceID.Value));
            }


            if (txtORG_ID.Value != "")
            {
                condObj.Like(HR_CHECKWORKDEVICE.Attribute.ORG_ID, Convert.ToString(txtORG_ID.Value));
            }


            if (txtUSE_FLAG.Value != "")
            {
                condObj.USE_FLAG = Convert.ToString(txtUSE_FLAG.Value);
            }

            listObj = BLLTable <HR_CHECKWORKDEVICE> .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)
    {
        #region//Ĭ�����ص���
        //hideTableColumnList = new List<AttributeItem>();
        //hideTableColumnList.Add(HR_CHECKWORKDEVICE.Attribute.EXP1);
        //hideTableColumnList.Add(HR_CHECKWORKDEVICE.Attribute.EXP2);
        //hideTableColumnList.Add(HR_CHECKWORKDEVICE.Attribute.EXP3);
        //valObj.LoadAllAttributes(true);//��ʱ�Ӵ˴��룬�Ժ��ܸ��½�����Ҫ
        //valObj.Remove(hideTableColumnList);

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

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

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

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

        }
    }
 private void GetOtherOrg(ref int deptCount, ref int staffCount, ref string msg)
 {
     deptCount = 0;
     staffCount = 0;
     msg = "";
     if (string.IsNullOrEmpty(hidCondition.Value))
         return;
     string[] deviceIds = hidCondition.Value.Split(',');
     HR_CHECKWORKDEVICE con = new HR_CHECKWORKDEVICE();
     con.In(HR_CHECKWORKDEVICE.Attribute.DeviceID, deviceIds);
     List<HR_CHECKWORKDEVICE> devList = BLLTable<HR_CHECKWORKDEVICE>.Factory(conn).Select(new HR_CHECKWORKDEVICE(), con);
     if (devList.Count < 1)
         return;
     List<DeviceOrg> orgList = new List<DeviceOrg>();
     msg += "<div class='maskmsgtool' style='width:500px; height:20px;'><a onclick=\"$('.main').unmask();\">�ر�</a></div>";
     msg += "<div class='msgtblist' style='width:500px;'>";
     msg += "<table style='width:100%;'>";
     msg += "    <thead>";
     msg += "        <tr>";
     msg += "            <td colspan='4' style='width:500px;'>��ϸ��Ϣ</td>";
     msg += "        </tr>";
     msg += "        <tr>";
     msg += "            <td style='width:60px;'>�豸ID</td>";
     msg += "            <td style='width:180px;'>�豸��</td>";
     msg += "            <td style='width:160px;'>���ű�(����/����)</td>";
     msg += "            <td style='width:160px;'>Ա����(����/����)</td>";
     msg += "        </tr>";
     msg += "    </thead>";
     msg += "    <tbody>";
     foreach (HR_CHECKWORKDEVICE dev in devList)
     {
         msg += "        <tr>";
         msg += "            <td class='first''>" + dev.DeviceID + "</td>";
         msg += "            <td>" + dev.DeviceName + "</td>";
         DeviceOrg devOrg = null;
         GetOtherOrg(dev, ref devOrg);
         orgList.Add(devOrg);
         msg += "            <td>" + devOrg.deptMsg + "</td>";
         msg += "            <td>" + devOrg.staffMsg + "</td>";
         msg += "        </tr>";
     }
     msg += "    </tbody>";
     RemoveRepeatAndInsertAioByName(orgList, ref deptCount, ref staffCount);
     msg += "    <tbody>";
     msg += "        <tr style='background:#eee;'>";
     msg += "            <td colspan='2' style='text-align:right;'>���ݲ���/Ա������ȥ�غ��ȡ��¼����</td>";
     msg += "            <td>" + staffCount + "</td>";
     msg += "            <td>" + deptCount + "</td>";
     msg += "        </tr>";
     msg += "    </tbody>";
     msg += "</table>";
     msg += "</div>";
 }
 private void GetOtherOrg(HR_CHECKWORKDEVICE dev, ref DeviceOrg devOrg)
 {
     devOrg = new DeviceOrg(dev);
     if (!devOrg.enable)
         return;
 }
Beispiel #22
0
    protected void btnOK_Click(object sender, EventArgs e)
    {
        try
        {
            HR_CHECKWORKDEVICE valObj = new HR_CHECKWORKDEVICE();


            if (txtDeviceID.Value != "")
            {
                valObj.DeviceID = Convert.ToString(txtDeviceID.Value);
            }

            if (txtDeviceName.Value != "")
            {
                valObj.DeviceName = txtDeviceName.Value;
            }

            if (!string.IsNullOrEmpty(wucSelORG1.ORG_ID))
            {
                valObj.ORG_ID = wucSelORG1.ORG_ID;
            }

            if (txtUSE_FLAG.Value != "")
            {
                valObj.USE_FLAG = Convert.ToString(txtUSE_FLAG.Value);
            }

            if (txtDeptTable.Value != "-1")
            {
                valObj.DeptTable = Convert.ToString(txtDeptTable.Value);
            }

            if (txtStaffTable.Value != "-1")
            {
                valObj.StaffTable = Convert.ToString(txtStaffTable.Value);
            }

            if (keyid != "")
            {
                valObj.DeviceID = keyid;
                count           = BLLTable <HR_CHECKWORKDEVICE> .Factory(conn).Update(valObj, HR_CHECKWORKDEVICE.Attribute.DeviceID);
            }
            else
            {
                count = BLLTable <HR_CHECKWORKDEVICE> .Factory(conn).Insert(valObj, HR_CHECKWORKDEVICE.Attribute.DeviceID);

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

                    //zlgchx
                    wucSelORG1 = new ASP.uctrl_sels_wucselorg_ascx();//UCtrl_wucSelORG();//


                    txtUSE_FLAG.Value = "";
                }
            }
        }
        catch (Exception ex)
        {
            litWarn.Text = ex.Message;
        }
    }
Beispiel #23
0
    protected void Page_Load(object sender, EventArgs e)
    {
        title      = "É豸±à¼­";
        Page.Title = title;
        if (!string.IsNullOrEmpty(Request["DeviceID"]))
        {
            keyid = Request["DeviceID"];
        }

        if (!string.IsNullOrEmpty(Request["KeyID"]))
        {
            keyid = Request["KeyID"];
        }
        if (!IsPostBack)
        {
            OtherDeviceHelper.GetTableDataSet(path, new HR_DEPT());
            OtherDeviceHelper.GetTableDataSet(path, new HR_STAFF());
            txtUSE_FLAG.Items.AddRange(FormHelper.GetListItem(HR_CHECKWORKDEVICE.Attribute.USE_FLAG));
            txtUSE_FLAG.Items.RemoveAt(0);

            ListItem[] deptTables  = new ListItem[0];
            ListItem[] staffTables = new ListItem[0];
            GetDeptAndStaffTableFangAnItems(ref deptTables, ref staffTables);
            txtDeptTable.Items.AddRange(deptTables);
            txtStaffTable.Items.AddRange(staffTables);

            this.txtDeviceID.Disabled            = true;
            this.txtDeviceID.Attributes["class"] = "dis";
            try
            {
                if (keyid != "")
                {
                    HR_CHECKWORKDEVICE val = new HR_CHECKWORKDEVICE();
                    HR_CHECKWORKDEVICE con = new HR_CHECKWORKDEVICE();
                    con._DeviceID = keyid;
                    HR_ORG pyVal = new HR_ORG();
                    pyVal._ORG_NAME = "";
                    Relation rt = new Relation(HR_CHECKWORKDEVICE.Attribute.ORG_ID, HR_ORG.Attribute.ORG_ID);
                    List <HR_CHECKWORKDEVICE> devList = BLLTable <HR_CHECKWORKDEVICE> .Factory(conn).Select(val, rt, pyVal, con);

                    if (devList == null || devList.Count < 1)
                    {
                        return;
                    }
                    txtDeviceID.Value   = Convert.ToString(devList[0].DeviceID); //Convert.ToString
                    txtDeviceName.Value = devList[0].DeviceName;
                    wucSelORG1.ORG_ID   = Convert.ToString(devList[0].ORG_ID);   //Convert.ToString
                    wucSelORG1.ORG_NAME = Convert.ToString(devList[0].GetValue(HR_ORG.Attribute.ORG_NAME));
                    txtUSE_FLAG.Value   = devList[0].USE_FLAG.ToString();
                    string file = devList[0].DeptTable;
                    file = string.IsNullOrEmpty(file) ? "" : file;
                    if (txtDeptTable.Items.FindByValue(file) != null)
                    {
                        txtDeptTable.Value = file;
                    }
                    else
                    {
                        if (txtDeptTable.Items.FindByValue("-1") == null)
                        {
                            txtDeptTable.Items.Add(new ListItem("´íÎó·½°¸", "-1"));
                        }
                        txtDeptTable.Value = "-1";
                    }
                    file = devList[0].StaffTable;
                    file = string.IsNullOrEmpty(file) ? "" : file;
                    if (txtStaffTable.Items.FindByValue(file) != null)
                    {
                        txtStaffTable.Value = file;
                    }
                    else
                    {
                        if (txtStaffTable.Items.FindByValue("-1") == null)
                        {
                            txtStaffTable.Items.Add(new ListItem("´íÎó·½°¸", "-1"));
                        }
                        txtStaffTable.Value = "-1";
                    }
                }
            }
            catch (Exception ex)
            {
                litWarn.Text = ex.Message;
            }
        }
    }
    protected void Page_Load(object sender, EventArgs e)
    {
        title = "�豸�༭";
        Page.Title = title;
        if (!string.IsNullOrEmpty(Request["DeviceID"]))
        {
            keyid = Request["DeviceID"];
        }

        if (!string.IsNullOrEmpty(Request["KeyID"]))
        {
            keyid = Request["KeyID"];
        }
        if (!IsPostBack)
        {
            OtherDeviceHelper.GetTableDataSet(path, new HR_DEPT());
            OtherDeviceHelper.GetTableDataSet(path, new HR_STAFF());
            txtUSE_FLAG.Items.AddRange(FormHelper.GetListItem(HR_CHECKWORKDEVICE.Attribute.USE_FLAG));
            txtUSE_FLAG.Items.RemoveAt(0);

            ListItem[] deptTables = new ListItem[0];
            ListItem[] staffTables = new ListItem[0];
            GetDeptAndStaffTableFangAnItems(ref deptTables, ref staffTables);
            txtDeptTable.Items.AddRange(deptTables);
            txtStaffTable.Items.AddRange(staffTables);

            this.txtDeviceID.Disabled = true;
            this.txtDeviceID.Attributes["class"] = "dis";
            try
            {
                if (keyid != "")
                {
                    HR_CHECKWORKDEVICE val = new HR_CHECKWORKDEVICE();
                    HR_CHECKWORKDEVICE con = new HR_CHECKWORKDEVICE();
                    con._DeviceID = keyid;
                    HR_ORG pyVal = new HR_ORG();
                    pyVal._ORG_NAME = "";
                    Relation rt = new Relation(HR_CHECKWORKDEVICE.Attribute.ORG_ID, HR_ORG.Attribute.ORG_ID);
                    List<HR_CHECKWORKDEVICE> devList = BLLTable<HR_CHECKWORKDEVICE>.Factory(conn).Select(val, rt, pyVal, con);
                    if (devList == null || devList.Count < 1) return;
                    txtDeviceID.Value = Convert.ToString(devList[0].DeviceID);//Convert.ToString
                    txtDeviceName.Value = devList[0].DeviceName;
                    wucSelORG1.ORG_ID = Convert.ToString(devList[0].ORG_ID);//Convert.ToString
                    wucSelORG1.ORG_NAME = Convert.ToString(devList[0].GetValue(HR_ORG.Attribute.ORG_NAME));
                    txtUSE_FLAG.Value = devList[0].USE_FLAG.ToString();
                    string file = devList[0].DeptTable;
                    file = string.IsNullOrEmpty(file) ? "" : file;
                    if (txtDeptTable.Items.FindByValue(file) != null)
                        txtDeptTable.Value = file;
                    else
                    {
                        if (txtDeptTable.Items.FindByValue("-1") == null)
                            txtDeptTable.Items.Add(new ListItem("���󷽰�", "-1"));
                        txtDeptTable.Value = "-1";
                    }
                    file = devList[0].StaffTable;
                    file = string.IsNullOrEmpty(file) ? "" : file;
                    if (txtStaffTable.Items.FindByValue(file) != null)
                        txtStaffTable.Value = file;
                    else
                    {
                        if (txtStaffTable.Items.FindByValue("-1") == null)
                            txtStaffTable.Items.Add(new ListItem("���󷽰�", "-1"));
                        txtStaffTable.Value = "-1";
                    }
                }
            }
            catch (Exception ex)
            {
                litWarn.Text = ex.Message;
            }
        }
    }
    private void BindList(HR_CHECKWORKDEVICE condObj, int curPage)
    {
        if (condObj.af_PageByAttributeItem == null)//����������û�����ķ�ҳ�������ԣ�����������������
            condObj.af_PageBy(HR_CHECKWORKDEVICE.Attribute.DeviceID, Order.Desc);

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

        #endregion
        //condObj.PID = decimal.Parse(pid);
        HR_ORG orgVal = new HR_ORG();
        orgVal._ORG_NAME = "";
        Relation rt = new Relation(HR_CHECKWORKDEVICE.Attribute.ORG_ID, HR_ORG.Attribute.ORG_ID);

        listObj = BLLTable<HR_CHECKWORKDEVICE>.Factory(conn).SelectByPage(valObj, rt, orgVal, condObj, aspPager.PageSize, curPage, ref recount);
        repList.DataSource = listObj;
        repList.DataBind();
        aspPager.RecordCount = recount;
    }
    protected void btnOK_Click(object sender, EventArgs e)
    {
        try
        {
            HR_CHECKWORKDEVICE valObj = new HR_CHECKWORKDEVICE();

            if(txtDeviceID.Value !="" )
                valObj.DeviceID = Convert.ToString(txtDeviceID.Value);

            if (txtDeviceName.Value != "")
                valObj.DeviceName = txtDeviceName.Value;

            if (!string.IsNullOrEmpty(wucSelORG1.ORG_ID))
                valObj.ORG_ID = wucSelORG1.ORG_ID;

            if(txtUSE_FLAG.Value !="" )
                valObj.USE_FLAG = Convert.ToString(txtUSE_FLAG.Value);

            if (txtDeptTable.Value != "-1")
                valObj.DeptTable = Convert.ToString(txtDeptTable.Value);

            if (txtStaffTable.Value != "-1")
                valObj.StaffTable = Convert.ToString(txtStaffTable.Value);

            if (keyid != "")
            {
                valObj.DeviceID = keyid;
                count = BLLTable<HR_CHECKWORKDEVICE>.Factory(conn).Update(valObj, HR_CHECKWORKDEVICE.Attribute.DeviceID);
            }
            else
            {
                count = BLLTable<HR_CHECKWORKDEVICE>.Factory(conn).Insert(valObj, HR_CHECKWORKDEVICE.Attribute.DeviceID);
                keyid = valObj.DeviceID.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
                {

                    txtDeviceID.Value ="";

                    //zlgchx
                    wucSelORG1 = new ASP.uctrl_sels_wucselorg_ascx();//UCtrl_wucSelORG();//

                    txtUSE_FLAG.Value ="";
                }
            }
        }
        catch (Exception ex)
        {
            litWarn.Text = ex.Message;
        }
    }