Exemple #1
0
        /// <summary>
        /// 创建新部门
        /// </summary>
        /// <returns></returns>
        private DepartmentData CreateDept()
        {
            DepartmentData newDept = new DepartmentData();

            newDept.Name = CreateDefaultName("部门");
            return(newDept);
        }
Exemple #2
0
    protected void btnSAVE_Click(object sender, EventArgs e)
    {
        //string sql = "Select * From DEPARTMENT Where DEPARTMENT_CODE='" + txtDepartmentCode.Text + "'";
        //List<DepartmentData> departmentChk = new Department().getDepartmentManual(sql);

        //if (departmentChk.Count > 0)
        //{
        //    Page.ClientScript.RegisterStartupScript(this.GetType(), "ShowBox", "alert('รหัสภาควิชาซ้ำ!');", true);
        //}
        //else
        {
            DepartmentData department = new DepartmentData();

            //department.Department_Code = txtDepartmentCode.Text;
            department.Department_Code        = getDepartmentMaxID("DEPARTMENT_CODE", "DEPARTMENT");
            department.Department_Thai        = txtDepartmentNameThai.Text;
            department.Department_Eng         = txtDepartmentNameEng.Text;
            department.Department_ShortName   = txtDepartmentShortName.Text;
            department.Department_FacultyCode = ddlFaculty.SelectedValue;
            //department.Department_Code_StudentID = txtGenerateStdCode.Text;
            department.Department_Code_StudentID = "00";
            department.Department_Status         = ddlDepartmentStatus.SelectedValue;

            string result = new Department().insertDepartment(department);
            Response.Redirect("list_Department.aspx?FacId=" + department.Department_FacultyCode);
        }
    }
Exemple #3
0
        private void treeView1_AfterSelect(object sender, System.Windows.Forms.TreeViewEventArgs e)
        {
            TreeNode node = e.Node;
            string   s    = node.Text;

            hbm.Department dep = DepartmentData.GetDepartmentFromName(s);
            IList          list;

            if (dep == null)
            {
                list = UserData.GetUsers();
            }
            else
            {
                list = dep.Users;
            }

            listView1.Items.Clear();
            foreach (Object o in list)
            {
                hbm._User    user = (hbm._User)o;
                ListViewItem item = new ListViewItem();
                item.Text = user.UserID;
                item.SubItems.Add(user.Name);
                item.SubItems.Add(Convert.ToString(user.Sex));
                item.SubItems.Add(Convert.ToString(user.Password));
                item.SubItems.Add(Convert.ToString(user.IsOnline));
                listView1.Items.Add(item);
            }
        }
        public async Task <IActionResult> AddUpdateDepartment([FromBody] DepartmentData department)
        {
            JsonResponse <bool> objResult = new JsonResponse <bool>();

            try
            {
                bool success = await this._superAdminService.AddUpdateDepartment(department);

                if (success)
                {
                    objResult.Data    = success;
                    objResult.Status  = StaticResource.SuccessStatusCode;
                    objResult.Message = StaticResource.SavedSuccessfulMessage;
                }
                else
                {
                    objResult.Data    = false;
                    objResult.Status  = StaticResource.DuplicateStatusCode;
                    objResult.Message = StaticResource.DepartmentCodeExist;
                }
            }
            catch (Exception ex)
            {
                HttpContext.RiseError(ex);
                objResult.Data    = false;
                objResult.Status  = StaticResource.FailStatusCode;
                objResult.Message = "Exception occured";
            }
            return(new OkObjectResult(objResult));
        }
Exemple #5
0
 private void btnCancel_Click(object sender, EventArgs e)
 {
     _personnel      = null;
     _secondaryData  = null;
     _departmentData = null;
     this.Close();
 }
Exemple #6
0
        public int EditDepartment(DepartmentData objDoDepartment)
        {
            try
            {
                System.Data.SqlClient.SqlParameter[] obj = new System.Data.SqlClient.SqlParameter[] {
                    new System.Data.SqlClient.SqlParameter("@ID", objDoDepartment.DeptID),
                    new System.Data.SqlClient.SqlParameter("@NAME_DEPT", objDoDepartment.Dept_name),
                    new System.Data.SqlClient.SqlParameter("@CODE", objDoDepartment.Dept_code),
                    new System.Data.SqlClient.SqlParameter("@FORM_TYPE", objDoDepartment.FormType),
                    new System.Data.SqlClient.SqlParameter("@Link", objDoDepartment.Link),
                    new System.Data.SqlClient.SqlParameter("@Vessel_Code", objDoDepartment.Vessel_Code),
                    new System.Data.SqlClient.SqlParameter("@Modified_By", objDoDepartment.CurrentUser),
                    new System.Data.SqlClient.SqlParameter("@AcClassiCode", objDoDepartment.Ac_Clssification_Code),
                    new System.Data.SqlClient.SqlParameter("@Approval_Group_Code ", objDoDepartment.Approval_Group_Code)
                };
                //obj[0].Value = DeptID;
                //obj[1].Value = Dept_name;
                //obj[2].Value = FormType;
                //obj[3].Value = Link;
                //obj[4].Value = Vessel_Code;
                //obj[5].Value = UserId;

                SqlHelper.ExecuteNonQuery(_internalConnection, CommandType.StoredProcedure, "[PURC_SP_upd_Lib_DEPARTMENTS]", obj);
                return(0);
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }
    protected void onUpdate(object source, CommandEventArgs e)
    {
        using (BLL_PURC_Purchase objTechService = new BLL_PURC_Purchase())
        {
            DepartmentData objDeptDo = new DepartmentData();
            HiddenFlag.Value = "Edit";

            OperationMode = "Edit PO Type";

            DataTable dtDept = new DataTable();
            dtDept = objTechService.Get_Req_POType(UDFLib.ConvertIntegerToNull(e.CommandArgument.ToString()));
            dtDept.DefaultView.RowFilter = "Id= '" + e.CommandArgument.ToString() + "'";

            ddlReqType.SelectedValue    = dtDept.DefaultView[0]["Reqsn_Type"].ToString();
            ddlPOType.SelectedValue     = dtDept.DefaultView[0]["PO_Type"].ToString();
            ddlBudgetCode.SelectedValue = dtDept.DefaultView[0]["Budget_Code"].ToString();
            ddlAccType.SelectedValue    = dtDept.DefaultView[0]["Account_Type"].ToString();
            txtBudgetID.Text            = dtDept.DefaultView[0]["ID"].ToString();
            objDeptDo.CurrentUser       = Session["userid"].ToString();



            string Deptmodal = String.Format("showModal('divadd',false);");
            ScriptManager.RegisterStartupScript(Page, Page.GetType(), "POType", Deptmodal, true);
        }
    }
    protected void Save_Click(object sender, EventArgs e)
    {
        using (BLL_PURC_Purchase objTechService = new BLL_PURC_Purchase())
        {
            DepartmentData objDeptDo = new DepartmentData();

            //objDeptDo.DeptID = txtDeptID.Text;
            //objDeptDo.Dept_code = txtCode.Text;
            //objDeptDo.Dept_name = TxtDept.Text;
            //objDeptDo.FormType = cmbFType.SelectedValue;
            //objDeptDo.CurrentUser = Session["userid"].ToString();
            //objDeptDo.Ac_Clssification_Code = ddlAcClassification.SelectedValue;
            objDeptDo.Vessel_Code = "0";
            if (HiddenFlag.Value == "Add")
            {
                //int count = objTechService.SaveDepartment(objDeptDo);
                int count = objBLLDept.SavePOType(UDFLib.ConvertIntegerToNull(ddlReqType.SelectedValue), UDFLib.ConvertIntegerToNull(ddlBudgetCode.SelectedValue),
                                                  ddlPOType.SelectedValue, ddlAccType.SelectedValue, GetSessionUserID());
            }
            else
            {
                int count = objBLLDept.UpdatePOType(UDFLib.ConvertIntegerToNull(txtBudgetID.Text), UDFLib.ConvertIntegerToNull(ddlReqType.SelectedValue), UDFLib.ConvertIntegerToNull(ddlBudgetCode.SelectedValue),
                                                    ddlPOType.SelectedValue, ddlAccType.SelectedValue, GetSessionUserID());
            }

            BindrgdDept();

            string hidemodal = String.Format("hideModal('divadd')");
            ScriptManager.RegisterStartupScript(Page, Page.GetType(), "hidemodal", hidemodal, true);
        }
    }
Exemple #9
0
        public int SaveDepartment(DepartmentData objDODepartment)
        {
            try
            {
                System.Data.SqlClient.SqlParameter[] sqlprm = new System.Data.SqlClient.SqlParameter[]
                {
                    new System.Data.SqlClient.SqlParameter("@NAME_DEPT", objDODepartment.Dept_name),
                    new System.Data.SqlClient.SqlParameter("@CODE", objDODepartment.Dept_code),
                    new System.Data.SqlClient.SqlParameter("@FORM_TYPE", objDODepartment.FormType),
                    new System.Data.SqlClient.SqlParameter("@Link", objDODepartment.Link),
                    new System.Data.SqlClient.SqlParameter("@Vessel_Code", objDODepartment.Vessel_Code),
                    new System.Data.SqlClient.SqlParameter("@Created_By", objDODepartment.CurrentUser),
                    new System.Data.SqlClient.SqlParameter("@AcClassiCode", objDODepartment.Ac_Clssification_Code),
                    new System.Data.SqlClient.SqlParameter("@Approval_Group_Code ", objDODepartment.Approval_Group_Code)
                };

                SqlHelper.ExecuteNonQuery(_internalConnection, CommandType.StoredProcedure, "[PURC_SP_Ins_Lib_DEPARTMENTS]", sqlprm);

                //=====================Return Code=======================
                //sqlprm[6].Direction = ParameterDirection.ReturnValue;
                //  SqlHelper.ExecuteNonQuery(_internalConnection, CommandType.StoredProcedure, "PURC_SP_Ins_Lib_DEPARTMENTS", sqlprm);
                //  return Convert.ToInt32(sqlprm[6].Value);
                //=======================================================

                return(0);
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }
Exemple #10
0
        /// <summary>
        /// 添加部门
        /// </summary>
        private void AddDept()
        {
            int count = this.tvwDeptList.Nodes.Count;

            if (count == 0)
            {
                SetEnabled(true);
            }
            else
            {
                /* 验证 */
                TreeNode node = this.tvwDeptList.SelectedNode;
                WriteNodeProperty(node);
            }

            ///创建部门
            DepartmentData newDept = CreateDept();

            _deptlist.Add(newDept);

            ///添加树节点
            TreeNode treeNode = new TreeNode();

            treeNode.Text = newDept.Name;
            treeNode.Tag  = newDept;
            this.tvwDeptList.Nodes.Add(treeNode);


            this.tvwDeptList.Select();
            this.tvwDeptList.SelectedNode = treeNode;
        }
        ////////////////////////////////////////View Monthly Bill
        public ActionResult MonthlyBill()
        {
            Employee u   = EmployeeData.FindByUserName((string)Session["username"]);
            int      uId = u.Id;
            int      dId = u.department.Id;

            Department dep = DepartmentData.GetDepById(dId);

            Dictionary <string, List <DepOrder> > monthlybill = new Dictionary <string, List <DepOrder> >();
            List <DepOrder> listdeporder = DepOrderData.GetDeliveredDepOrderByDepId(dep.Id);

            var iter = from deporder in listdeporder orderby deporder.signindate descending group deporder by new { month = deporder.signindate.Month, year = deporder.signindate.Year } into d select new { dt = string.Format("{0}/{1}", d.Key.month, d.Key.year), detail = d.ToList() };

            foreach (var grp in iter)
            {
                List <DepOrder> mlist = new List <DepOrder>();
                foreach (var dor in grp.detail)
                {
                    mlist.Add(dor);
                }
                monthlybill.Add(grp.dt, mlist);
            }

            ViewBag.dep         = dep;
            ViewBag.monthlybill = monthlybill;
            return(View());
        }
Exemple #12
0
    //Pongsarun 26/9/2015: use for config system
    public string insertDepartment(DepartmentData dataInsert)
    {
        string response = "";


        ConnectDB     db        = new ConnectDB();
        SqlDataSource oracleObj = db.ConnectionOracle();

        string sql = "";

        sql = "Insert Into DEPARTMENT(DEPARTMENT_CODE, DEPARTMENT_THAINAME, DEPARTMENT_ENGNAME, DEPARTMENT_SHORTNAME, FACULTY_CODE, DEPARTMENT_STATUS, DEPARTMENT_CODE_STUDENTID) Values('" + dataInsert.Department_Code + "','" + dataInsert.Department_Thai + "','" + dataInsert.Department_Eng + "','" + dataInsert.Department_ShortName + "','" + dataInsert.Department_FacultyCode + "','" + dataInsert.Department_Status + "','" + dataInsert.Department_Code_StudentID + "')";

        oracleObj.InsertCommand = sql;

        try
        {
            if (oracleObj.Insert() == 1)
            {
                response = "OK";
            }
        }
        catch (Exception e)
        {
            response = e.Message.ToString();
        }
        return(response);
    }
Exemple #13
0
    protected void btnSAVE_Click(object sender, EventArgs e)
    {
        DepartmentData departmentSave = new DepartmentData();

        departmentSave.Department_Code        = txtDepartmentCode.Text;
        departmentSave.Department_Thai        = txtDepartmentNameThai.Text;
        departmentSave.Department_Eng         = txtDepartmentNameEng.Text;
        departmentSave.Department_ShortName   = txtDepartmentShortName.Text;
        departmentSave.Department_FacultyCode = ddlFaculty.SelectedValue;
        departmentSave.Department_Status      = ddlDepartmentStatus.SelectedValue;
        //departmentSave.Department_Code_StudentID = txtGenerateStdCode.Text;
        departmentSave.Department_Code_StudentID = "00";

        try
        {
            String result = new Department().updateDepartment(departmentSave);
            if (result.Equals("OK"))
            {
                Response.Redirect("list_Department.aspx?FacId=" + departmentSave.Department_FacultyCode);
                //lblTest.Text = facultySave.Faculty_Thai;
            }
        }
        catch
        {
            Response.Redirect("list_Department.aspx?FacId=" + departmentSave.Department_FacultyCode);
        }
    }
Exemple #14
0
 public async Task <bool> AddUpdateDepartment(DepartmentData department)
 {
     try
     {
         var checkCode = this.therapistContext.MasterDepartment.Where(x => x.DepartmentCode == department.DepartmentCode).ToList();
         if (department.DepartmentId > 0)
         {
             checkCode = this.therapistContext.MasterDepartment.Where(x => x.DepartmentCode == department.DepartmentCode && x.DepartmentId != department.DepartmentId).ToList();
         }
         if (checkCode.Count() == 0)
         {
             IEnumerable <DepartmentsList> departmentsList = new List <DepartmentsList>();
             using (IDbConnection con = new SqlConnection(_connectionString))
             {
                 departmentsList = await con.QueryAsync <DepartmentsList>("dbo.SSP_addUpdateDepartment", new
                 {
                     DepartmentName = department.DepartmentName,
                     DepartmentCode = department.DepartmentCode,
                     DepartmentId   = department.DepartmentId,
                     CreatedBy      = department.CreatedBy,
                 }, commandType : CommandType.StoredProcedure);
             }
             return(true);
         }
         else
         {
             return(false);
         }
     }
     catch (Exception ex)
     {
         throw ex;
     }
 }
Exemple #15
0
        // AJAX
        // Reject Department Requests
        public ActionResult Ajax_Reject_Department_Request(ajax_model ajax_model_data)
        {
            ajax_model ajax_data = new ajax_model
            {
                name      = ajax_model_data.name,
                main_data = ajax_model_data.main_data,
            };

            using (var db = new DataBaseContext())
            {
                List <orders> order_lis = db.orders_repository.Where(or => or.staff_obj.department_obj.department_name == ajax_data.name).ToList();

                foreach (orders or in order_lis)
                {
                    or.order_status = "Rejected_by_Clerk";

                    db.SaveChanges();
                }
            }
            object reply_to_client = new
            {
                key_itemname_lis = "SUCCESS",
            };

            //Email Notification
            staff  rep      = StaffData.GetStaffByName(DepartmentData.GetRepresentativebyDepName(ajax_data.name));
            string emailadd = rep.email;
            Task   task     = Task.Run(() => {
                EmailNotification.SendNotificationEmailToEmployee(emailadd, "New Disbursment Order Reminder", "There is a new disbursment order to your department was rejected by store clerk.");
            });

            return(Json(reply_to_client, JsonRequestBehavior.AllowGet));
        }
        /// <summary>
        /// Reads all records grouped by their department name
        /// </summary>
        /// <returns>The returned grouped collection</returns>
        public string RecordsGroupedByDepartment()
        {
            string final   = "";
            var    toGroup = EmployeeData.Select(emp => new
            {
                FirstName  = emp.FirstName,
                LastName   = emp.LastName,
                Email      = emp.Email,
                Phone      = emp.PhoneNumber,
                HireDate   = emp.HireDate.ToLongDateString(),
                Salary     = emp.Salary,
                Department = (emp.DepartmentId == null) ? null : DepartmentData.First(dept => dept.DepartmentId == emp.DepartmentId).DepartmentName
            }).GroupBy(item => item.Department).ToList();

            toGroup.ForEach(group =>
            {
                //string key = group.Key == null ? "Null" : group.Key;
                final += "\n Department - " + (@group.Key ?? "Null") + ":\n";
                final += " FirstName || LastName || Email || PhoneNumber || HireDate || Salary || Department\n";

                group.ToList().ForEach(item =>
                {
                    final += $" {item.FirstName}    {item.LastName}     {item.Email}    {item.Phone}    {item.HireDate} {item.Salary}   {item.Department} \n";
                });
            });

            return(final);
        }
Exemple #17
0
    public List <DepartmentData> getDepartmentWithFaculty(string faculty_code)
    {
        List <DepartmentData> Department_data = new List <DepartmentData>();

        ConnectDB     db        = new ConnectDB();
        SqlDataSource oracleObj = db.ConnectionOracle();

        oracleObj.SelectCommand = "Select * From DEPARTMENT Where FACULTY_CODE='" + faculty_code + "' And DEPARTMENT_STATUS='0001' Order By DEPARTMENT_CODE";
        DataView allData = (DataView)oracleObj.Select(DataSourceSelectArguments.Empty);

        foreach (DataRowView rowData in allData)
        {
            DepartmentData Department = new DepartmentData();
            Department.Department_Code           = rowData["DEPARTMENT_CODE"].ToString();
            Department.Department_Thai           = rowData["DEPARTMENT_THAINAME"].ToString();
            Department.Department_Eng            = rowData["DEPARTMENT_ENGNAME"].ToString();
            Department.Department_ShortName      = rowData["DEPARTMENT_SHORTNAME"].ToString();
            Department.Department_FacultyCode    = rowData["FACULTY_CODE"].ToString();
            Department.Department_Status         = rowData["DEPARTMENT_STATUS"].ToString();
            Department.Department_Code_StudentID = rowData["DEPARTMENT_CODE_STUDENTID"].ToString();
            Department_data.Add(Department);
        }

        return(Department_data);
    }
Exemple #18
0
        public ActionResult CollectedDepOrder()
        {
            Dictionary <int, Dictionary <int, int> > plannedlist = new Dictionary <int, Dictionary <int, int> >();

            List <Department> ldep = DepartmentData.GetAllDep();

            //load the collected dep order

            foreach (int depId in ldep.Select(x => x.Id))
            {
                List <DepOrder> listdp = DepOrderData.GetCollectedDepOrderByDepId(depId);

                Dictionary <int, int> dp = new Dictionary <int, int>();
                foreach (int itemId in listdp.Select(x => x.item.Id))
                {
                    dp.Add(itemId, listdp.Where(x => x.item.Id == itemId).FirstOrDefault().collectedquant);
                }
                if (!plannedlist.ContainsKey(depId))
                {
                    plannedlist.Add(depId, dp);
                }
                else
                {
                    plannedlist[depId] = dp;
                }
            }
            Session["plannedlist"] = plannedlist;


            ViewBag.Rlist = plannedlist;
            Session.Remove("collist");
            Session.Remove("plannedlist");

            return(View());
        }
        public async Task <IActionResult> GetDepartmentById(int departmentId)
        {
            JsonResponse <DepartmentData> objResult = new JsonResponse <DepartmentData>();

            try
            {
                DepartmentData department = await this._superAdminService.GetDepartmentById(departmentId);

                if (department != null)
                {
                    objResult.Data    = department;
                    objResult.Status  = StaticResource.SuccessStatusCode;
                    objResult.Message = StaticResource.SuccessMessage;
                    return(new OkObjectResult(objResult));
                }
            }
            catch (Exception ex)
            {
                HttpContext.RiseError(ex);
                objResult.Data    = null;
                objResult.Status  = StaticResource.FailStatusCode;
                objResult.Message = "Exception occured";
            }
            return(new OkObjectResult(objResult));
        }
Exemple #20
0
        private void WorkerDepartment_DoWork(object sender, DoWorkEventArgs e)
        {
            // Executes when RunWorkerAsync() is called

            List <Department> dataReceived = new DepartmentData().GetDepartmentList(); //change for other all

            e.Result = dataReceived;
        }
Exemple #21
0
 public DataRepository()
 {
     ApplicationUser = new ApplicationUserData();
     Department      = new DepartmentData();
     Role            = new RoleData();
     Worker          = new WorkerData();
     Project         = new ProjectData();
 }
Exemple #22
0
 public DepartmentData(DepartmentData data)
 {
     Name      = data.Name;
     GroupName = data.GroupName;
     Employees = data.Employees;
     EmployeeDepartmentHistories = data.EmployeeDepartmentHistories;
     ModifiedDate = data.ModifiedDate;
     Uid          = data.Uid;
 }
Exemple #23
0
        /// <summary>
        /// 绑定下拉列表的值
        /// </summary>
        private void DropDown(int?dept, int?position)
        {
            DepartmentData deptdb = new DepartmentData();

            ViewData["DeptId"] = new SelectList(deptdb.GetAllDepart(), "DeptId", "DeptName", dept);
            PositionData positiondb = new PositionData();

            ViewData["PositionId"] = new SelectList(positiondb.GetAllPosition(), "PositionId", "PosName", position);
        }
Exemple #24
0
        public ActionResult GenerateDelOrder()
        {
            Dictionary <int, int> collist = new Dictionary <int, int>();

            if (Session["collist"] != null)
            {
                collist = (Dictionary <int, int>)Session["collist"];
            }
            else
            {
                Session["collist"] = new Dictionary <int, int>();
            }


            List <ReqItem> lri       = ReqItemData.GetAllReqItemApproved();
            var            itemIdset = new HashSet <int>(collist.Keys);
            var            depIdset  = new HashSet <int>(lri.Select(x => x.emp.department.Id).ToList());
            List <ReqItem> slist     = new List <ReqItem>();
            List <ReqItem> xlist     = new List <ReqItem>();
            Dictionary <int, Dictionary <int, int> > list = new Dictionary <int, Dictionary <int, int> >();



            foreach (int depId in depIdset)
            {
                slist = lri.Where(x => x.emp.department.Id == depId).ToList();

                Dictionary <int, int> itemmap = new Dictionary <int, int>();
                foreach (int itemId in itemIdset)
                {
                    xlist = slist.Where(x => x.item.Id == itemId).ToList();
                    int    quant = xlist.Select(x => x.Quant).Sum();
                    double price = StockCardData.GetLatestPriceByItem(ItemData.GetItemById(itemId));
                    if (quant != 0)
                    {
                        itemmap.Add(itemId, quant);
                    }
                    DepOrderData.CreateDepOrder(depId, itemId, quant, price);

                    //Withdraw from stock
                    Item item    = ItemData.GetItemById(itemId);
                    int  balance = StockCardData.GetStockBalanceByItem(item);
                    StockCardData.WithdrawFromStockRecord(item, DateTime.Today, DepartmentData.GetDepById(depId), quant, balance);
                    int stockbalance = StockCardData.GetStockBalanceByItem(item);

                    //if (stockbalance < item.ReorderLevel) Send Notification
                }
                list.Add(depId, itemmap);
            }
            ViewBag.Rlist          = list;
            Session["plannedlist"] = list;



            return(View());
        }
Exemple #25
0
    /// <summary>
    /// Gridview Edit Button Event.
    /// </summary>
    /// <param name="source"></param>
    /// <param name="e"></param>
    protected void onUpdate(object source, CommandEventArgs e)
    {
        try
        {
            using (BLL_PURC_Purchase objTechService = new BLL_PURC_Purchase())
            {
                DepartmentData objDeptDo = new DepartmentData();
                HiddenFlag.Value = "Edit";

                OperationMode = "Edit Department";

                DeptID = e.CommandArgument.ToString();
                DataTable dtDept = new DataTable();
                dtDept = objTechService.GetDepartmentMaster();
                dtDept.DefaultView.RowFilter = "Id= '" + e.CommandArgument.ToString() + "'";
                txtDeptID.Text = dtDept.DefaultView[0]["ID"].ToString();
                TxtDept.Text   = dtDept.DefaultView[0]["Name_Dept"].ToString();
                txtCode.Text   = dtDept.DefaultView[0]["Code"].ToString();
                //ddlAcClassification.SelectedValue = dtDept.DefaultView[0]["Ac_Classi_Code"].ToString() != "" ? dtDept.DefaultView[0]["Ac_Classi_Code"].ToString() : "0";
                //JIT_3675_Pranali16072015_
                ddlAcClassification.SelectedValue = PreventUnlistedValueError(ddlAcClassification, Convert.ToString(dtDept.DefaultView[0]["Ac_Classi_Code"]));
                ddlApprovalGroup.SelectedValue    = PreventUnlistedValueError(ddlApprovalGroup, Convert.ToString(dtDept.DefaultView[0]["Approval_Group_Code"]));
                cmbFType.ClearSelection();


                if (dtDept.DefaultView[0]["Form_Type"].ToString() == "Stores".ToUpper())
                {
                    cmbFType.SelectedValue = "ST";
                }

                if (dtDept.DefaultView[0]["Form_Type"].ToString() == "Spares".ToUpper())
                {
                    cmbFType.SelectedValue = "SP";
                }

                if (dtDept.DefaultView[0]["Form_Type"].ToString() == "repairs".ToUpper())
                {
                    cmbFType.SelectedValue = "RP";
                }

                objDeptDo.CurrentUser = Session["userid"].ToString();

                txtCode.Enabled             = false;
                cmbFType.Enabled            = false;
                ddlAcClassification.Enabled = false;
                ddlApprovalGroup.Enabled    = false;

                string Deptmodal = String.Format("showModal('divadd',false);");
                ScriptManager.RegisterStartupScript(Page, Page.GetType(), "Deptmodal", Deptmodal, true);
            }
        }
        catch (Exception ex)
        {
            UDFLib.WriteExceptionLog(ex);
        }
    }
        public IActionResult DeleteDepartment(int id)
        {
            if (ModelState.IsValid)
            {
                DepartmentData.DeleteDepartment(id);
                return(RedirectToAction("DepartmentList"));
            }

            return(View());
        }
Exemple #27
0
 public Form4(Form3 f3, Personnel getPersonnel, SecondaryData getSecondaryData)
 {
     InitializeComponent();
     f3.Close();
     _personnel      = new Personnel();
     _secondaryData  = new SecondaryData();
     _departmentData = new DepartmentData();
     _personnel      = getPersonnel;
     _secondaryData  = getSecondaryData;
 }
        public IActionResult AddDepartment(Department department)
        {
            if (ModelState.IsValid)
            {
                DepartmentData.AddDepartment(department);
                return(RedirectToAction("DepartmentList"));
            }

            return(View(department));
        }
Exemple #29
0
 private void GetValue(DepartmentData dep)
 {
     this.tbxLinkMan.Text      = dep.LinkMan;
     this.tbxLinkEmail.Text    = dep.Email;
     this.tbxLinkAddress.Text  = dep.Address;
     this.tbxLinkFax.Text      = dep.Fax;
     this.tbxLinkPhone.Text    = dep.Phone;
     this.tbxPhone.Text        = dep.MobilePhone;
     this.tbxLinkPostCode.Text = dep.PostCode;
 }
Exemple #30
0
        public JsonResult ChangeCollectingPoint(string cp)
        {
            Employee   emp = EmployeeData.FindByUserName((string)Session["username"]);
            Department dep = DepartmentData.GetDepById(emp.department.Id);

            DepartmentData.SetColPoint(dep.Id, cp);

            object new_amount = new { cp = cp };

            return(Json(new_amount, JsonRequestBehavior.AllowGet));
        }