public ActionResult DeleteEmployeeMethod()
        {
            try
            {
                var staffIDStr = Request["staffID"];///员工主键ID


                string creatPersonIDsStr = Session["id"] == null ? "" : Session["id"].ToString();
                int    staffID           = -1;
                int    createPersonID    = -1;
                if (int.TryParse(staffIDStr, out staffID) && int.TryParse(creatPersonIDsStr, out createPersonID))
                {
                    string errMsg = "";
                    if (EmployeeManage.DeleteEmployee(staffID, createPersonID, ref errMsg))
                    {
                        return(Content("ok"));
                    }
                    else
                    {
                        return(Content(errMsg));
                    }
                }
                else
                {
                    return(Content("请输入正确的Int类型!"));
                }
            }
            catch (Exception ex)
            {
                return(Content(ex.Message));
            }
        }
 public ActionResult AddDepartmentMethod()
 {
     try
     {
         //int parentID, string departmentName, int creatPersonID, ref string errMsg
         var    parentIDStr       = Request["parentID"];       ///部门父节点ID,没有则为0
         var    departmentName    = Request["departmentName"]; //部门名称
         string creatPersonIDsStr = Session["id"] == null ? "" : Session["id"].ToString();
         int    parentID          = -1;
         int    createPersonID    = -1;
         if (int.TryParse(parentIDStr, out parentID) && int.TryParse(creatPersonIDsStr, out createPersonID))
         {
             string errMsg = "";
             if (EmployeeManage.AddDepartment(parentID, departmentName, createPersonID, ref errMsg))
             {
                 return(Content("ok"));
             }
             else
             {
                 return(Content(errMsg));
             }
         }
         else
         {
             return(Content("请输入正确的Int类型!"));
         }
     }
     catch (Exception ex)
     {
         return(Content(ex.Message));
     }
 }
        public ActionResult AlterStaffItemselfInfoMethod()
        {
            //AlterEmployeeInfo(int staffId, string staffName,int personId, string tel, string userName, string passWord, string mailBox, int? processTypeId,List <int> authorityList, ref string errMsg
            try
            {
                var staffIdStr = Request["staffId"];      //员工主键Id

                var passWordOld = Request["passWordOld"]; //员工登录密码旧
                var passWordNew = Request["passWordNew"]; //员工登录密码新
                int staffId     = -1;

                if (int.TryParse(staffIdStr, out staffId))
                {
                    string errMsg = "";
                    if (EmployeeManage.AlterItemselfPassword(staffId, passWordOld, passWordNew, ref errMsg))
                    {
                        return(Content("ok"));
                    }
                    else
                    {
                        return(Content(errMsg));
                    }
                }
                else
                {
                    return(Content("请输入正确的Int数据类型!"));
                }
            }
            catch (Exception ex)
            {
                return(Content(ex.Message));
            }
        }
Esempio n. 4
0
        private void CboBind()
        {
            //绑定仓库
            DepotManage DepotManage = new DepotManage();
            DataTable   dtl         = DepotManage.GetDepotData();

            cboDepotOut.Items.Add("");
            for (int i = 0; i < dtl.Rows.Count; i++)
            {
                cboDepotOut.Items.Add(dtl.Rows[i]["仓库名称"].ToString());
            }


            //绑定仓库
            dtl = DepotManage.GetDepotData();
            cboDepotIn.Items.Add("");
            for (int i = 0; i < dtl.Rows.Count; i++)
            {
                cboDepotIn.Items.Add(dtl.Rows[i]["仓库名称"].ToString());
            }

            //绑定经手人
            EmployeeManage EmployeeManage = new EmployeeManage();

            dtl = EmployeeManage.GetEmployeeData();
            cboHandlePerson.Items.Add("");
            for (int i = 0; i < dtl.Rows.Count; i++)
            {
                cboHandlePerson.Items.Add(dtl.Rows[i]["员工姓名"].ToString());
            }
        }
 public ActionResult DeletePositionMethod()
 {
     try
     {
         var positionIdStr = Request["positionId"];
         var personIdStr   = Session["id"];
         int positionId    = -1;
         int personId      = -1;
         if (int.TryParse(positionIdStr, out positionId) && int.TryParse(personIdStr.ToString(), out personId))
         {
             string errMsg = "";
             if (EmployeeManage.DeletePosition(positionId, personId, ref errMsg))
             {
                 return(Content("ok"));
             }
             else
             {
                 return(Content(errMsg));
             }
         }
         else
         {
             return(Content("请输入正确的Int数据类型!"));
         }
     }
     catch (Exception ex)
     {
         return(Content(ex.Message));
     }
 }
Esempio n. 6
0
        private void frmCheckBill_Load(object sender, EventArgs e)
        {
            BeginDate.Text = DateTime.Now.Year.ToString() + "-" + DateTime.Now.Month.ToString() + "-01";
            endDate.Text   = DateTime.Now.ToShortDateString();

            LoadBill();

            //绑定调出仓库
            DepotManage DepotManage = new DepotManage();
            DataTable   dtl         = DepotManage.GetDepotData();

            cboDepot.Items.Add("");
            for (int i = 0; i < dtl.Rows.Count; i++)
            {
                cboDepot.Items.Add(dtl.Rows[i]["仓库名称"].ToString());
            }

            //绑定经手人
            EmployeeManage EmployeeManage = new EmployeeManage();

            dtl = EmployeeManage.GetEmployeeData();
            cboHandlePerson.Items.Add("");
            for (int i = 0; i < dtl.Rows.Count; i++)
            {
                cboHandlePerson.Items.Add(dtl.Rows[i]["员工姓名"].ToString());
            }
        }
 public ActionResult AlterDepartmengInfoMethod()
 {
     try
     {
         var departmentIdStr = Request["departmentId"];
         var departmentName  = Request["departmentName"];
         var personIdStr     = Session["id"];
         int departmentId    = -1;
         int personId        = -1;
         if (int.TryParse(departmentIdStr, out departmentId) && int.TryParse(personIdStr.ToString(), out personId))
         {
             string errMsg = "";
             if (EmployeeManage.AlterDepartment(departmentId, departmentName, personId, ref errMsg))
             {
                 return(Content("ok"));
             }
             else
             {
                 return(Content(errMsg));
             }
         }
         else
         {
             return(Content("请输入正确的Int数据类型!"));
         }
     }
     catch (Exception ex)
     {
         return(Content(ex.Message));
     }
 }
Esempio n. 8
0
        private void frmBill_Load(object sender, EventArgs e)
        {
            BeginDate.Text = DateTime.Now.Year.ToString() + "-" + DateTime.Now.Month.ToString() + "-01";
            endDate.Text   = DateTime.Now.ToShortDateString();


            LoadBill();

            //绑定仓库
            DepotManage DepotManage = new DepotManage();
            DataTable   dtl         = DepotManage.GetDepotData();

            cboDepot.Items.Add("");
            for (int i = 0; i < dtl.Rows.Count; i++)
            {
                cboDepot.Items.Add(dtl.Rows[i]["仓库名称"].ToString());
            }


            //绑定类型
            dtl = DepotManage.GetStorageTypeData("I");
            cboStorageType.Items.Add("");
            for (int i = 0; i < dtl.Rows.Count; i++)
            {
                cboStorageType.Items.Add(dtl.Rows[i]["StorageTypeName"].ToString());
            }


            //绑定部门
            DeptManage DeptManage = new DeptManage();

            dtl = DeptManage.GetDeptData();
            cboDept.Items.Add("");
            for (int i = 0; i < dtl.Rows.Count; i++)
            {
                cboDept.Items.Add(dtl.Rows[i]["部门名称"].ToString());
            }


            //绑定经手人
            EmployeeManage EmployeeManage = new EmployeeManage();

            dtl = EmployeeManage.GetEmployeeData();
            cboHandlePerson.Items.Add("");
            for (int i = 0; i < dtl.Rows.Count; i++)
            {
                cboHandlePerson.Items.Add(dtl.Rows[i]["员工姓名"].ToString());
            }


            //绑定供应商
            SupplierManage SupplierManage = new SupplierManage();

            dtl = SupplierManage.GetSupplierData();
            cboSupplier.Items.Add("");
            for (int i = 0; i < dtl.Rows.Count; i++)
            {
                cboSupplier.Items.Add(dtl.Rows[i]["供应商名称"].ToString());
            }
        }
 public ActionResult AddAuthorityMethod()
 {
     try
     {
         var    parentIDStr       = Request["parentID"];      ///权限父节点ID
         var    authorityName     = Request["authorityName"]; //员工名称
         string creatPersonIDsStr = Session["id"] == null ? "" : Session["id"].ToString();
         int    parentID          = -1;
         int    createPersonID    = -1;
         if (int.TryParse(parentIDStr, out parentID) && int.TryParse(creatPersonIDsStr, out createPersonID))
         {
             string errMsg = "";
             if (EmployeeManage.AddAuthority(parentID, authorityName, createPersonID, ref errMsg))
             {
                 return(Content("ok"));
             }
             else
             {
                 return(Content(errMsg));
             }
         }
         else
         {
             return(Content("请输入正确的int类型"));
         }
     }
     catch (Exception ex)
     {
         return(Content(ex.Message));
     }
 }
Esempio n. 10
0
        //下载
        private void repositoryItemButtonEdit2_Click(object sender, EventArgs e)
        {
            //获取当前文件的FileDataAttachmentGuid
            if (gridView2.RowCount > 0)
            {
                //得到当前登陆人员所在部门
                EmployeeManage EmployeeManage = new EmployeeManage();
                string         strDept        = EmployeeManage.GetEmpDeptByEmpName(SysParams.UserName);

                string strEmpGuid = EmployeeManage.GetEmpGuIDByEmpName(SysParams.UserName);

                string strFileGuID = ((DataRowView)(gridView1.GetFocusedRow())).Row["FileGuid"].ToString();

                if (rightgroupManage.IsOperateRightByUserID(SysParams.UserID, "FileAllView", "Qry") == false)
                {
                    //判断是否有下载权限
                    FileApplyManage FileApplyManage = new FileApplyManage();
                    if (FileApplyManage.IsDownloadByUserID(strEmpGuid, strDept, strFileGuID) == false)
                    {
                        this.ShowAlertMessage("你没有权限下载此文件!");
                        return;
                    }


                    // this.ShowAlertMessage("你没有权限下载此文件!");
                    // return;
                }



                string guid = ((DataRowView)(gridView2.GetFocusedRow())).Row["FileDataAttachmentGuid"].ToString();



                FileDataManage FileDataManage = new FileDataManage();
                DataTable      dtl            = FileDataManage.GetFileDataAttachmentByAttachmentGuid(guid);

                if (dtl.Rows.Count > 0)
                {
                    Byte[] bytes = (Byte[])dtl.Rows[0]["FileContent"];


                    //先将文件下载到本地
                    SaveFileDialog SaveFileDialog1 = new SaveFileDialog();
                    SaveFileDialog1.FileName = dtl.Rows[0]["FileSourceName"].ToString();
                    SaveFileDialog1.Filter   = "All   files   (*.*)|*.* ";

                    SaveFileDialog1.RestoreDirectory = true;

                    if (SaveFileDialog1.ShowDialog() == DialogResult.OK)
                    {
                        string     strfilepath = SaveFileDialog1.FileName;
                        FileStream fs          = new FileStream(strfilepath, FileMode.OpenOrCreate, FileAccess.Write);
                        fs.Write(bytes, 0, bytes.Length);
                        fs.Close();
                    }
                }
            }
        }
Esempio n. 11
0
        private void frmBill_Load(object sender, EventArgs e)
        {
            LoadBill();

            //绑定仓库
            DepotManage DepotManage = new DepotManage();
            DataTable   dtl         = DepotManage.GetDepotData();

            cboDepot.Items.Add("");
            for (int i = 0; i < dtl.Rows.Count; i++)
            {
                cboDepot.Items.Add(dtl.Rows[i]["仓库名称"].ToString());
            }


            //绑定类型
            dtl = DepotManage.GetStorageTypeData("E");
            cboStorageType.Items.Add("");
            for (int i = 0; i < dtl.Rows.Count; i++)
            {
                cboStorageType.Items.Add(dtl.Rows[i]["StorageTypeName"].ToString());
            }


            //绑定部门
            DeptManage DeptManage = new DeptManage();

            dtl = DeptManage.GetDeptData();
            cboDept.Items.Add("");
            for (int i = 0; i < dtl.Rows.Count; i++)
            {
                cboDept.Items.Add(dtl.Rows[i]["部门名称"].ToString());
            }


            //绑定经手人
            EmployeeManage EmployeeManage = new EmployeeManage();

            dtl = EmployeeManage.GetEmployeeData();
            cboHandlePerson.Items.Add("");
            for (int i = 0; i < dtl.Rows.Count; i++)
            {
                cboHandlePerson.Items.Add(dtl.Rows[i]["员工姓名"].ToString());
            }

            //绑定客户
            ClientManage ClientManage = new ClientManage();

            dtl = ClientManage.GetClientData();
            cboSupplier.Items.Add("");
            for (int i = 0; i < dtl.Rows.Count; i++)
            {
                cboSupplier.Items.Add(dtl.Rows[i]["客户名称"].ToString());
            }
        }
 /// <summary>
 /// 获取所有的部门
 /// </summary>
 /// <returns></returns>
 public ActionResult GetAllDepartmentMethod()
 {
     try
     {
         return(Json(EmployeeManage.GetAllDepartmentOnly(0, ""), JsonRequestBehavior.AllowGet));
     }
     catch
     {
         return(null);
     }
 }
 /// <summary>
 /// 获取所有权限
 /// </summary>
 /// <returns></returns>
 //[HttpPost]
 public ActionResult GetAuthority()
 {
     try
     {
         return(Json(EmployeeManage.GetAuthority(0), JsonRequestBehavior.AllowGet));
     }
     catch (Exception ex)
     {
         return(Content(ex.Message));
     }
 }
        public ActionResult AddEmployeeMethod()
        {
            try
            {
                var parentIDStr      = Request["parentID"];             ///职位父节点ID
                var staffName        = Request["staffName"];            //员工名称
                var tel              = Request["tel"];                  //员工电话
                var userName         = Request["userName"];             //员工登录名
                var passWord         = Request["passWord"];             //员工登录密码
                var mailBox          = Request["mailBox"];              //员工邮箱
                var processTypeIdStr = Request["processTypeId"];        //员工所属加工类型Id
                // var compontProcessTypeIdStr = Request["compontProcessTypeId"];//员工所属加工类型Id
                var compontProcessTypeIdStr = Request["processTypeId"]; //员工所属加工类型Id
                int?compontProcessTypeId    = null;

                string creatPersonIDsStr = Session["id"] == null ? "" : Session["id"].ToString();
                int    parentID          = -1;
                int    createPersonID    = -1;
                int?   processTypeId     = null;
                if (processTypeIdStr != null && processTypeIdStr != "0")
                {
                    processTypeId = Convert.ToInt32(processTypeIdStr);
                }
                if (compontProcessTypeIdStr != null && compontProcessTypeIdStr != "0")
                {
                    compontProcessTypeId = Convert.ToInt32(compontProcessTypeIdStr);
                }
                if (int.TryParse(parentIDStr, out parentID) && int.TryParse(creatPersonIDsStr, out createPersonID))
                {
                    string errMsg = "";
                    if (EmployeeManage.AddEmployee(parentID, staffName, tel, userName, passWord, mailBox, createPersonID, processTypeId, compontProcessTypeId, ref errMsg))
                    {
                        return(Content("ok"));
                    }
                    else
                    {
                        return(Content(errMsg));
                    }
                }
                else
                {
                    return(Content("请输入正确的Int类型!"));
                }
            }
            catch (Exception ex)
            {
                return(Content(ex.Message));
            }
        }
        /// <summary>
        /// 数据选择:1:员工 2:部门  3:供应商  4:客户
        /// </summary>
        /// <param name="flag"></param>
        public void ShowSelectData(int flag)
        {
            intFlag = flag;
            DataTable dtl = new DataTable();

            switch (flag)
            {
            case 1:     //员工
                EmployeeManage EmployeeManage = new EmployeeManage();
                dtl = EmployeeManage.GetEmployeeDataBySelect2();
                gridControl1.DataSource      = dtl;
                gridView1.Columns[1].Caption = "员工姓名";
                this.Text = "员工选择";
                break;
            }
            this.ShowDialog();
        }
        /// <summary>
        /// 数据选择:1:员工 2:部门  3:供应商  4:客户
        /// </summary>
        /// <param name="flag"></param>
        public void ShowSelectData(int flag)
        {
            intFlag = flag;
            DataTable dtl = new DataTable();

            switch (flag)
            {
            case 1:     //员工
                EmployeeManage EmployeeManage = new EmployeeManage();
                dtl = EmployeeManage.GetEmployeeDataBySelect();
                gridControl1.DataSource      = dtl;
                gridView1.Columns[1].Caption = "员工编号";
                gridView1.Columns[2].Caption = "员工姓名";
                gridView1.Columns[3].Caption = "部门";
                this.Text = "员工选择";
                break;

            case 2:     //部门
                DeptManage DeptManage = new DeptManage();
                dtl = DeptManage.GetDeptDataBySelect();
                gridControl1.DataSource      = dtl;
                gridView1.Columns[1].Caption = "部门名称";
                this.Text = "部门选择";
                break;

            case 3:     //供应商
                SupplierManage SupplierManage = new SupplierManage();
                dtl = SupplierManage.GetSupplierDataBySelect();
                gridControl1.DataSource      = dtl;
                gridView1.Columns[1].Caption = "供应商名称";
                this.Text = "供应商选择";
                break;

            case 4:     //客户
                ClientManage ClientManage = new ClientManage();
                dtl = ClientManage.GetClientDataBySelect();
                gridControl1.DataSource      = dtl;
                gridView1.Columns[1].Caption = "客户名称";
                this.Text = "客户选择";
                break;
            }

            gridView1.Columns[0].Visible = false;
            this.ShowDialog();
        }
        public ActionResult AlterPositionInfoMethod()
        {
            try
            {
                //int parentID, string positionName, int creatPersonID, List<int> limltList, ref string errMsg
                var positionIdStr = Request["positionId"];   ///部门父节点ID
                var positionName  = Request["positionName"]; //职位名称
                var limliStr      = Request["limlt"];        //该职位的权限ID集合

                List <string> limltListStr = limliStr.Split(',').ToList();
                List <int>    limltList    = new List <int>();
                foreach (var item in limltListStr)
                {
                    int _int = -1;
                    if (int.TryParse(item, out _int))
                    {
                        limltList.Add(_int);
                    }
                }
                string creatPersonIDsStr = Session["id"] == null ? "" : Session["id"].ToString();
                int    positionID        = -1;
                int    createPersonID    = -1;
                if (int.TryParse(positionIdStr, out positionID) && int.TryParse(creatPersonIDsStr, out createPersonID))
                {
                    string errMsg = "";
                    if (EmployeeManage.AlterPositionInfo(positionID, positionName, limltList, createPersonID, ref errMsg))
                    {
                        return(Content("ok"));
                    }
                    else
                    {
                        return(Content(errMsg));
                    }
                }
                else
                {
                    return(Content("请输入正确的Int类型!"));
                }
            }
            catch (Exception ex)
            {
                return(Content(ex.Message));
            }
        }
Esempio n. 18
0
        /// <summary>
        /// 加载数据
        /// </summary>
        /// <param name="MaterialGuid"></param>
        private void FillData(string EmployeeGuid)
        {
            EmployeeManage Employeemanage = new EmployeeManage();
            DataTable      dtl            = Employeemanage.GetEmployeeData(EmployeeGuid);

            if (dtl.Rows.Count > 0)
            {
                txtGuid.Text      = dtl.Rows[0]["EmpGuid"].ToString();
                txtEmpId.Text     = dtl.Rows[0]["EmpID"].ToString();
                txtEmpName.Text   = dtl.Rows[0]["EmpName"].ToString();
                txtTelephone.Text = dtl.Rows[0]["Telephone"].ToString();
                txtCardID.Text    = dtl.Rows[0]["CardID"].ToString();
                txtAddress.Text   = dtl.Rows[0]["Address"].ToString();
                txtDept.Text      = dtl.Rows[0]["Dept"].ToString();
                txtSex.Text       = dtl.Rows[0]["Sex"].ToString();
            }

            this.ShowDialog();
        }
 public ActionResult GetEmployeeInfoMethod()
 {
     try
     {
         var staffIdStr = Request["staffId"];//员工Id
         int staffId    = -1;
         if (int.TryParse(staffIdStr, out staffId))
         {
             var list = EmployeeManage.GetEmployeeInfo(staffId);
             return(Json(list, JsonRequestBehavior.AllowGet));
         }
         else
         {
             return(Content("请输入正确的Int数据类型!"));
         }
     }
     catch (Exception ex)
     {
         return(Content(ex.Message));
     }
 }
 public ActionResult GetAuthorityByPositionMethod()
 {
     try
     {
         var position   = Request["positionId"];
         int positionId = -1;
         if (int.TryParse(position, out positionId))
         {
             var list = EmployeeManage.GetAuthorityByPosition(positionId);
             return(Json(list, JsonRequestBehavior.AllowGet));
         }
         else
         {
             return(Content("请输入正确的Int数据类型!"));
         }
     }
     catch (Exception ex)
     {
         return(Content(ex.Message));
     }
 }
Esempio n. 21
0
        /// <summary>
        /// 加载数据
        /// </summary>
        /// <param name="MaterialGuid"></param>
        private void FillData(string EmployeeGuid)
        {
            //绑定部门
            cboDataBind(cboDept);

            EmployeeManage Employeemanage = new EmployeeManage();
            DataTable      dtl            = Employeemanage.GetEmployeeData(EmployeeGuid);

            if (dtl.Rows.Count > 0)
            {
                txtGuid.Text      = dtl.Rows[0]["EmpGuid"].ToString();
                txtEmpId.Text     = dtl.Rows[0]["EmpID"].ToString();
                txtEmpName.Text   = dtl.Rows[0]["EmpName"].ToString();
                txtTelephone.Text = dtl.Rows[0]["Telephone"].ToString();
                txtCardID.Text    = dtl.Rows[0]["CardID"].ToString();
                txtAddress.Text   = dtl.Rows[0]["Address"].ToString();
                txtSex.Text       = dtl.Rows[0]["Sex"].ToString();
                if (dtl.Rows[0]["IsEnable"].ToString() == "1")
                {
                    chkIsEnable.Checked = true;
                }
                else
                {
                    chkIsEnable.Checked = false;
                }


                for (int i = 0; i < cboDept.Items.Count; i++)
                {
                    ListItem item = cboDept.Items[i] as ListItem;
                    if (item.Value.Trim() == dtl.Rows[0]["Dept"].ToString().Trim())
                    {
                        cboDept.SelectedIndex = i;
                        break;
                    }
                }
            }

            this.ShowDialog();
        }
 public ActionResult GetPositionOfDepartmentByStaff()
 {
     try
     {
         var parentIDStr = Request["staffID"];///部门节点ID
         // GetDepartmentPosition(int parentID
         int parentID = -1;
         if (int.TryParse(parentIDStr, out parentID))
         {
             var list = EmployeeManage.GetDepartmentPositionByStaff(parentID);
             return(Json(new { code = 0, data = list }, JsonRequestBehavior.AllowGet));
         }
         else
         {
             return(Content("请输入正确的部门ID"));
         }
     }
     catch (Exception ex)
     {
         return(Content(ex.Message));
     }
 }
        public ActionResult LonOn()
        {
            var    userName       = Request["userName"];
            var    passWord       = Request["passWord"];
            string errMsg         = "";
            string limlt          = "";;
            string staffName      = "";
            int    id             = 0;
            int    processTypeId  = -1;
            string processTypeStr = "";
            string user           = "";

            if (EmployeeManage.LonigOn(userName, passWord, out limlt, out user, out staffName, out id, out processTypeId, out processTypeStr, ref errMsg))
            {
                Session["name"]           = staffName;
                Session["id"]             = id;
                Session["limit"]          = limlt;
                Session["processTypeId"]  = processTypeId;
                Session["processTypeStr"] = processTypeStr;
                Session["user"]           = user;
            }
            return(Content(errMsg));
        }
        public ActionResult AlterStaffInfoMethod()
        {
            //AlterEmployeeInfo(int staffId, string staffName,int personId, string tel, string userName, string passWord, string mailBox, int? processTypeId,List <int> authorityList, ref string errMsg
            try
            {
                var staffIdStr       = Request["staffId"];
                var staffName        = Request["staffName"];            //员工名称
                var tel              = Request["tel"];                  //员工电话
                var positionIdStr    = Request["positionId"];           //职位
                var userName         = Request["userName"];             //员工登录名
                var passWord         = Request["passWord"];             //员工登录密码
                var mailBox          = Request["mailBox"];              //员工邮箱
                var processTypeIdStr = Request["processTypeId"];        //员工所属加工类型Id
                //var compontProcessTypeIdStr = Request["compontProcessTypeId"];//员工所属加工类型Id
                var compontProcessTypeIdStr = Request["processTypeId"]; //员工所属加工类型Id
                //var limliStr = Request["limlt"];//该职位的权限ID集合
                int staffId       = -1;
                int positionId    = 0;
                int?processTypeId = null;
                if (processTypeIdStr != null && processTypeIdStr != "0")
                {
                    processTypeId = Convert.ToInt32(processTypeIdStr);
                }
                int?compontProcessTypeId = null;
                if (compontProcessTypeIdStr != null && compontProcessTypeIdStr != "0")
                {
                    compontProcessTypeId = Convert.ToInt32(compontProcessTypeIdStr);
                }
                // List<string> limltListStr = limliStr.Split(',').ToList();
                //List<int> limltList = new List<int>();
                //foreach (var item in limltListStr)
                //{
                //    int _int = -1;
                //    if (int.TryParse(item, out _int))
                //    {
                //        limltList.Add(_int);
                //    }
                //}
                string creatPersonIDsStr = Session["id"] == null ? "" : Session["id"].ToString();
                int    createPersonID    = -1;

                if (int.TryParse(positionIdStr, out positionId) && int.TryParse(staffIdStr, out staffId) && int.TryParse(creatPersonIDsStr.ToString(), out createPersonID))
                {
                    string errMsg = "";
                    if (EmployeeManage.AlterEmployeeInfo(staffId, positionId, staffName, createPersonID, tel, userName, passWord, mailBox, processTypeId, compontProcessTypeId, ref errMsg))
                    {
                        return(Content("ok"));
                    }
                    else
                    {
                        return(Content(errMsg));
                    }
                }
                else
                {
                    return(Content("请输入正确的Int数据类型!"));
                }
            }
            catch (Exception ex)
            {
                return(Content(ex.Message));
            }
        }
Esempio n. 25
0
        private void btnMEmployeeInfo_Click(object sender, EventArgs e)
        {
            EmployeeManage employeeManage = new EmployeeManage();

            employeeManage.ShowDialog();
        }
Esempio n. 26
0
        private void CboBind(string flag)
        {
            //绑定仓库
            DepotManage DepotManage = new DepotManage();
            DataTable   dtl         = DepotManage.GetDepotData();

            cboDepot.Items.Add("");
            for (int i = 0; i < dtl.Rows.Count; i++)
            {
                cboDepot.Items.Add(dtl.Rows[i]["仓库名称"].ToString());
            }


            //绑定类型
            dtl = DepotManage.GetStorageTypeData(flag);
            cboStorageType.Items.Add("");
            for (int i = 0; i < dtl.Rows.Count; i++)
            {
                cboStorageType.Items.Add(dtl.Rows[i]["StorageTypeName"].ToString());
            }


            //绑定部门
            DeptManage DeptManage = new DeptManage();

            dtl = DeptManage.GetDeptData();
            cboDept.Items.Add("");
            for (int i = 0; i < dtl.Rows.Count; i++)
            {
                cboDept.Items.Add(dtl.Rows[i]["部门名称"].ToString());
            }


            //绑定经手人
            EmployeeManage EmployeeManage = new EmployeeManage();

            dtl = EmployeeManage.GetEmployeeData();
            cboHandlePerson.Items.Add("");
            for (int i = 0; i < dtl.Rows.Count; i++)
            {
                cboHandlePerson.Items.Add(dtl.Rows[i]["员工姓名"].ToString());
            }

            //绑定供应商
            if (flag == "I")
            {
                SupplierManage SupplierManage = new SupplierManage();
                dtl = SupplierManage.GetSupplierData();
                cboSupplier.Items.Add("");
                for (int i = 0; i < dtl.Rows.Count; i++)
                {
                    cboSupplier.Items.Add(dtl.Rows[i]["供应商名称"].ToString());
                }
            }
            else
            {
                ClientManage ClientManage = new ClientManage();
                dtl = ClientManage.GetClientData();
                cboSupplier.Items.Add("");
                for (int i = 0; i < dtl.Rows.Count; i++)
                {
                    cboSupplier.Items.Add(dtl.Rows[i]["客户名称"].ToString());
                }
            }
        }