public int DoesEmployeeExist(clsSubCategoryAssignment objClsSubCategoryAssignment)
        {
            try
            {
                int            noOfRowsReturned = 0;
                SqlParameter[] sqlParams        = new SqlParameter[1];

                sqlParams[0]           = new SqlParameter("@EmployeeID", SqlDbType.Int, 4);
                sqlParams[0].Value     = objClsSubCategoryAssignment.EmployeeID;
                sqlParams[0].Direction = ParameterDirection.Input;

                noOfRowsReturned = Convert.ToInt32(SqlHelper.ExecuteScalar(strConnectionString, CommandType.StoredProcedure, "sp_DoesEmployeeExist", sqlParams));
                return(noOfRowsReturned);
            }
            catch (V2Exceptions ex)
            {
                throw;
            }

            catch (System.Exception ex)
            {
                FileLog objFileLog = FileLog.GetLogger();
                objFileLog.WriteLine(LogType.Error, ex.Message, "clsDLSubCategoryAssignment.cs", "DoesEmployeeExist", ex.StackTrace);
                throw new V2Exceptions();
            }
        }
        public void InsertEmployee(clsSubCategoryAssignment objClsSubCategoryAssignment)
        {
            try
            {
                SqlParameter[] sqlParams = new SqlParameter[4];
                sqlParams[0]           = new SqlParameter("@EmployeeID", SqlDbType.Int, 4);
                sqlParams[0].Value     = objClsSubCategoryAssignment.EmployeeID;
                sqlParams[0].Direction = ParameterDirection.Input;

                sqlParams[1]           = new SqlParameter("@EmployeeEmailID", SqlDbType.VarChar, 100);
                sqlParams[1].Value     = objClsSubCategoryAssignment.EmployeeEmailID;
                sqlParams[1].Direction = ParameterDirection.Input;

                sqlParams[2]           = new SqlParameter("@EmployeeName", SqlDbType.VarChar, 100);
                sqlParams[2].Value     = objClsSubCategoryAssignment.EmployeeName;
                sqlParams[2].Direction = ParameterDirection.Input;

                sqlParams[3]           = new SqlParameter("@IsActive", SqlDbType.Bit, 1);
                sqlParams[3].Value     = objClsSubCategoryAssignment.IsActive;
                sqlParams[3].Direction = ParameterDirection.Input;

                SqlHelper.ExecuteNonQuery(strConnectionString, CommandType.StoredProcedure, "sp_InsertEmployee", sqlParams);
            }
            catch (V2Exceptions ex)
            {
                throw;
            }

            catch (System.Exception ex)
            {
                FileLog objFileLog = FileLog.GetLogger();
                objFileLog.WriteLine(LogType.Error, ex.Message, "clsDLSubCategoryAssignment.cs", "InsertEmployee", ex.StackTrace);
                throw new V2Exceptions();
            }
        }
        public DataSet GetAssignedSubCategories(clsSubCategoryAssignment objSubCategoryAssignment)
        {
            try
            {
                DataSet        dsAssignedSubCategories = new DataSet();
                SqlParameter[] objParam = new SqlParameter[1];

                objParam[0]       = new SqlParameter("@EmployeeID", SqlDbType.Int);
                objParam[0].Value = objSubCategoryAssignment.EmployeeID;

                dsAssignedSubCategories = SqlHelper.ExecuteDataset(strConnectionString, CommandType.StoredProcedure, "sp_GetAssignedSubCategories", objParam);
                return(dsAssignedSubCategories);
            }
            catch (V2Exceptions ex)
            {
                throw;
            }

            catch (System.Exception ex)
            {
                FileLog objFileLog = FileLog.GetLogger();
                objFileLog.WriteLine(LogType.Error, ex.Message, "clsDLSubCategoryAssignment.cs", "GetAssignedSubCategories", ex.StackTrace);
                throw new V2Exceptions();
            }
        }
        public void InsertEmployeeRoles()
        {
            try
            {
                fillNewTable();
                InsertEmployee();
                InsertSubcategoryAssignment();
                lblSuccessMessage.Visible = true;
                lblSuccessMessage.Text    = "Sub-Categories have been successfully assigned to " + ddlEmployeeName.SelectedItem.Text + ".";

                for (int recordCount = 0; recordCount <= dtNewTable.Rows.Count - 1; recordCount++)
                {
                    clsSubCategoryAssignment objClsSubCategoryAssignment = new clsSubCategoryAssignment();
                    objClsSubCategoryAssignment.EmployeeID = Convert.ToInt32(dtNewTable.Rows[recordCount][0]);
                    objClsSubCategoryAssignment.CategoryID = Convert.ToInt32(dtNewTable.Rows[recordCount][1]);
                    objClsSubCategoryAssignment.IsSysAdmin = Convert.ToInt32(dtNewTable.Rows[recordCount][2]);
                    clsBLSubCategoryAssignment objClsBLSubCategoryAssignment = new clsBLSubCategoryAssignment();
                    objClsBLSubCategoryAssignment.InsertEmployeeRoles(objClsSubCategoryAssignment);
                }
            }
            catch (V2Exceptions ex)
            {
                throw;
            }
            catch (System.Exception ex)
            {
                FileLog objFileLog = FileLog.GetLogger();
                objFileLog.WriteLine(LogType.Error, ex.Message, "SubCategoryAssignment.aspx", "InsertEmployeeRoles", ex.StackTrace);
                throw new V2Exceptions(ex.ToString(), ex);
            }
        }
        public DataSet FetchRecordForEdit1(clsSubCategoryAssignment objSubCategoryAssignment)
        {
            try
            {
                SqlParameter[] sqlParams = new SqlParameter[1];
                sqlParams[0]           = new SqlParameter("@EmployeeId", SqlDbType.Int, 4);
                sqlParams[0].Value     = objSubCategoryAssignment.EmployeeID;
                sqlParams[0].Direction = ParameterDirection.Input;
                //sqlParams[1] = new SqlParameter("@SuperAdminEmployeeId", SqlDbType.Int, 4);
                //sqlParams[1].Value = objSubCategoryAssignment.SuerAdminEmployeeId;
                //sqlParams[1].Direction = ParameterDirection.Input;

                DataSet dsGetData = SqlHelper.ExecuteDataset(strConnectionString, CommandType.StoredProcedure, "sp_GetDetailOfEmployeeToAvailable2", sqlParams);
                return(dsGetData);
            }
            catch (V2Exceptions ex)
            {
                throw;
            }

            catch (System.Exception ex)
            {
                FileLog objFileLog = FileLog.GetLogger();
                objFileLog.WriteLine(LogType.Error, ex.Message, "clsDLSubCategoryAssignment.cs", "FetchRecordForEdit1", ex.StackTrace);
                throw new V2Exceptions();
            }
        }
        public void CheckSuperAdmin1(clsSubCategoryAssignment objClsSubCategoryAssignment)
        {
            try
            {
                SqlParameter[] sqlParams = new SqlParameter[2];

                sqlParams[0]           = new SqlParameter("@EmployeeID", SqlDbType.Int, 4);
                sqlParams[0].Value     = objClsSubCategoryAssignment.EmployeeID;
                sqlParams[0].Direction = ParameterDirection.Input;
                sqlParams[1]           = new SqlParameter("@CategoryID", SqlDbType.Int, 4);
                sqlParams[1].Value     = objClsSubCategoryAssignment.CategoryID;
                sqlParams[1].Direction = ParameterDirection.Input;
                SqlHelper.ExecuteScalar(strConnectionString, CommandType.StoredProcedure, "sp_CheckSuperAdmin1", sqlParams);
            }
            catch (V2Exceptions ex)
            {
                throw;
            }

            catch (System.Exception ex)
            {
                FileLog objFileLog = FileLog.GetLogger();
                objFileLog.WriteLine(LogType.Error, ex.Message, "clsDLSubCategoryAssignment.cs", "CheckSuperAdmin1", ex.StackTrace);
                throw new V2Exceptions();
            }
        }
 protected void btnSubmit_Click(object sender, System.EventArgs e)
 {
     try
     {
         //InsertEmployee();
         //InsertSubcategoryAssignment();
         clsSubCategoryAssignment   objClsSubCategoryAssignment   = new clsSubCategoryAssignment();
         clsBLSubCategoryAssignment objClsBLSubCategoryAssignment = new clsBLSubCategoryAssignment();
         objClsSubCategoryAssignment.EmployeeID = Convert.ToInt32(ddlEmployeeName.SelectedItem.Value);
         int noOfRowsReturned = objClsBLSubCategoryAssignment.DoesEmployeeExist(objClsSubCategoryAssignment);
         if (noOfRowsReturned == 0)
         {
             lblEmployee.Visible = false;
             InsertEmployeeRoles();
         }
         else
         {
             lblEmployee.Visible       = true;
             lblEmployee.Text          = "EmployeeID " + objClsSubCategoryAssignment.EmployeeID + " already exists";
             lblSuccessMessage.Visible = false;
         }
     }
     catch (V2Exceptions ex)
     {
         throw;
     }
     catch (System.Exception ex)
     {
         FileLog objFileLog = FileLog.GetLogger();
         objFileLog.WriteLine(LogType.Error, ex.Message, "SubCategoryAssignment.aspx", "btnSubmit_Click", ex.StackTrace);
         throw new V2Exceptions(ex.ToString(), ex);
     }
 }
        public void UpdateSubCategoryAssignment(clsSubCategoryAssignment objClsSubCategoryAssignment)
        {
            try
            {
                SqlParameter[] sqlParams = new SqlParameter[2];

                sqlParams[0]           = new SqlParameter("@subCategoryID", SqlDbType.VarChar, 5000);
                sqlParams[0].Value     = objClsSubCategoryAssignment.SubCategoryID;
                sqlParams[0].Direction = ParameterDirection.Input;

                sqlParams[1]           = new SqlParameter("@EmployeeID", SqlDbType.Int, 4);
                sqlParams[1].Value     = objClsSubCategoryAssignment.EmployeeID;
                sqlParams[1].Direction = ParameterDirection.Input;

                //sqlParams[2] = new SqlParameter("@SuperAdminEmployeeID", SqlDbType.Int, 4);
                //sqlParams[2].Value = objClsSubCategoryAssignment.SuerAdminEmployeeId;
                //sqlParams[2].Direction = ParameterDirection.Input;

                SqlHelper.ExecuteNonQuery(strConnectionString, CommandType.StoredProcedure, "sp_UpdateSubCategoryAssignmentNew", sqlParams);
            }
            catch (V2Exceptions ex)
            {
                throw;
            }

            catch (System.Exception ex)
            {
                FileLog objFileLog = FileLog.GetLogger();
                objFileLog.WriteLine(LogType.Error, ex.Message, "clsDLSubCategoryAssignment.cs", "UpdateSubCategoryAssignment", ex.StackTrace);
                throw new V2Exceptions();
            }
        }
        public void InsertSubcategoryAssignment()
        {
            try
            {
                string subCategoryList = "";
                if (lbSelectedAdminSubCategories != null)
                {
                    //Response.Write(lbSelectedAdminSubCategories.Items.ToString());

                    /*for (int i=0; i <= lbSelectedAdminSubCategories.Items.Count-1; i++)
                     * {
                     *  subCategoryList = subCategoryList + lbSelectedAdminSubCategories.Items + ",";
                     * }*/
                    foreach (ListItem item in lbSelectedAdminSubCategories.Items)
                    {
                        subCategoryList = subCategoryList + item.Value + ",";
                    }
                }
                if (lbSelectedHRSubCategories != null)
                {
                    foreach (ListItem item in lbSelectedHRSubCategories.Items)
                    {
                        subCategoryList = subCategoryList + item.Value + ",";
                    }
                }
                if (lbSelectedITSubCategories != null)
                {
                    foreach (ListItem item in lbSelectedITSubCategories.Items)
                    {
                        subCategoryList = subCategoryList + item.Value + ",";
                    }
                }
                subCategoryList = subCategoryList.Trim(',');
                clsSubCategoryAssignment objClsSubCategoryAssignment = new clsSubCategoryAssignment();
                objClsSubCategoryAssignment.SubCategoryID = subCategoryList;
                objClsSubCategoryAssignment.EmployeeID    = Convert.ToInt32(ddlEmployeeName.SelectedItem.Value);
                clsBLSubCategoryAssignment objClsBLSubCategoryAssignment = new clsBLSubCategoryAssignment();
                objClsBLSubCategoryAssignment.InsertSubCategoryAssignment(objClsSubCategoryAssignment);
            }
            catch (V2Exceptions ex)
            {
                throw;
            }
            catch (System.Exception ex)
            {
                FileLog objFileLog = FileLog.GetLogger();
                objFileLog.WriteLine(LogType.Error, ex.Message, "SubCategoryAssignment.aspx", "InsertSubcategoryAssignment", ex.StackTrace);
                throw new V2Exceptions(ex.ToString(), ex);
            }
        }
Exemple #10
0
        public string getEmployeeEmailID(clsSubCategoryAssignment objClsSubCategoryAssignment)
        {
            try
            {
                clsDLSubCategoryAssignment objClsDLSubCategoryAssignment = new clsDLSubCategoryAssignment();
                return(objClsDLSubCategoryAssignment.getEmployeeEmailID(objClsSubCategoryAssignment));
            }
            catch (V2Exceptions ex)
            {
                throw;
            }

            catch (System.Exception ex)
            {
                FileLog objFileLog = FileLog.GetLogger();
                objFileLog.WriteLine(LogType.Error, ex.Message, "clsBLSubCategoryAssignment.cs", "getEmployeeEmailID", ex.StackTrace);
                throw new V2Exceptions(ex.ToString(), ex);
            }
        }
Exemple #11
0
        public DataSet CountNoOfCategory(clsSubCategoryAssignment objSubCategoryAssignment)
        {
            try
            {
                clsDLSubCategoryAssignment objClsDLSubCategoryAssignment = new clsDLSubCategoryAssignment();
                return(objClsDLSubCategoryAssignment.CountNoOfCategory(objSubCategoryAssignment));
            }
            catch (V2Exceptions ex)
            {
                throw;
            }

            catch (System.Exception ex)
            {
                FileLog objFileLog = FileLog.GetLogger();
                objFileLog.WriteLine(LogType.Error, ex.Message, "clsBLSubCategoryAssignment.cs", "CountNoOfCategory", ex.StackTrace);
                throw new V2Exceptions();
            }
        }
Exemple #12
0
        public int DoesEmployeeExist(clsSubCategoryAssignment objClsSubCategoryAssignment)
        {
            try
            {
                clsDLSubCategoryAssignment objClsDLSubCategoryAssignment = new clsDLSubCategoryAssignment();
                return(objClsDLSubCategoryAssignment.DoesEmployeeExist(objClsSubCategoryAssignment));
            }
            catch (V2Exceptions ex)
            {
                throw;
            }

            catch (System.Exception ex)
            {
                FileLog objFileLog = FileLog.GetLogger();
                objFileLog.WriteLine(LogType.Error, ex.Message, "clsBLSubCategoryAssignment.cs", "DoesEmployeeExist", ex.StackTrace);
                throw new V2Exceptions();
            }
        }
Exemple #13
0
        public void deleteSubCategory(clsSubCategoryAssignment objClsSubCategoryAssignment)
        {
            try
            {
                clsDLSubCategoryAssignment objClsDLSubCategoryAssignment = new clsDLSubCategoryAssignment();
                objClsDLSubCategoryAssignment.deleteSubCategory(objClsSubCategoryAssignment);
            }
            catch (V2Exceptions ex)
            {
                throw;
            }

            catch (System.Exception ex)
            {
                FileLog objFileLog = FileLog.GetLogger();
                objFileLog.WriteLine(LogType.Error, ex.Message, "clsBLSubCategoryAssignment.cs", "deleteSubCategory", ex.StackTrace);
                throw new V2Exceptions();
            }
        }
Exemple #14
0
        public void CheckSuperAdmin1(clsSubCategoryAssignment objClsSubCategoryAssignment)
        {
            try
            {
                clsDLSubCategoryAssignment objClsDLSubCategoryAssignment = new clsDLSubCategoryAssignment();
                objClsDLSubCategoryAssignment.CheckSuperAdmin1(objClsSubCategoryAssignment);
            }
            catch (V2Exceptions ex)
            {
                throw;
            }

            catch (System.Exception ex)
            {
                FileLog objFileLog = FileLog.GetLogger();
                objFileLog.WriteLine(LogType.Error, ex.Message, "clsBLSubCategoryAssignment.cs", "CheckSuperAdmin1", ex.StackTrace);
                throw new V2Exceptions(ex.ToString(), ex);
            }
        }
Exemple #15
0
        public DataSet CheckForSuperUser(clsSubCategoryAssignment objSubCategoryAssignment)
        {
            try
            {
                clsDLSubCategoryAssignment objClsDLSubCategoryAssignment = new clsDLSubCategoryAssignment();
                return(objClsDLSubCategoryAssignment.CheckForSuperUser(objSubCategoryAssignment));
            }
            catch (V2Exceptions ex)
            {
                throw;
            }

            catch (System.Exception ex)
            {
                FileLog objFileLog = FileLog.GetLogger();
                objFileLog.WriteLine(LogType.Error, ex.Message, "clsBLSubCategoryAssignment.cs", "CheckForSuperUser", ex.StackTrace);
                throw new V2Exceptions(ex.ToString(), ex);
            }
        }
 public void dgCategories_IsCateogrySelected(object sender, System.EventArgs e)
 {
     try
     {
         CheckBox     chkIsCategorySelected = (CheckBox)sender;
         DataGridItem item = (DataGridItem)chkIsCategorySelected.Parent.Parent;
         clsBLSubCategoryAssignment objClsBLSubCategoryAssignment = new clsBLSubCategoryAssignment();
         clsSubCategoryAssignment   objClsSubCategoryAssignment   = new clsSubCategoryAssignment();
         DataSet dsAdminSubCategories = objClsBLSubCategoryAssignment.getSubCategories();
         if (((CheckBox)item.FindControl("chkBoxCategory")).Text == "Admin")
         {
             if (chkIsCategorySelected.Checked == false)
             {
                 RemoveAllAdmin();
             }
         }
         else if (((CheckBox)item.FindControl("chkBoxCategory")).Text == "IT")
         {
             if (chkIsCategorySelected.Checked == false)
             {
                 RemoveAllIT();
             }
         }
         else if (((CheckBox)item.FindControl("chkBoxCategory")).Text == "HR")
         {
             if (chkIsCategorySelected.Checked == false)
             {
                 RemoveAllHR();
             }
         }
     }
     catch (V2Exceptions ex)
     {
         throw;
     }
     catch (System.Exception ex)
     {
         FileLog objFileLog = FileLog.GetLogger();
         objFileLog.WriteLine(LogType.Error, ex.Message, "SubCategoryAssignment.aspx", "dgCategories_IsCateogrySelected", ex.StackTrace);
         throw new V2Exceptions(ex.ToString(), ex);
     }
 }
Exemple #17
0
 public void bindEmployeeNames(clsSubCategoryAssignment objSubCategoryAssignment)
 {
     try
     {
         dsBindEmployeeNames = objClsBLSubCategoryAssignment.getEmployeeName(objSubCategoryAssignment);
         if (dsBindEmployeeNames.Tables[0].Rows.Count > 0)
         {
             txtEmployeeName.Text = dsBindEmployeeNames.Tables[0].Rows[0][0].ToString();
         }
     }
     catch (V2Exceptions ex)
     {
         throw;
     }
     catch (System.Exception ex)
     {
         FileLog objFileLog = FileLog.GetLogger();
         objFileLog.WriteLine(LogType.Error, ex.Message, "EditEmployeeDetail.aspx", "bindEmployeeNames", ex.StackTrace);
         throw new V2Exceptions(ex.ToString(), ex);
     }
 }
 //To Bind the ListBoxes with the SubCategories fetched form the Databse
 private void bindSubCategories()
 {
     try
     {
         clsBLSubCategoryAssignment objClsBLSubCategoryAssignment = new clsBLSubCategoryAssignment();
         clsSubCategoryAssignment   objClsSubCategoryAssignment   = new clsSubCategoryAssignment();
         DataSet dsAdminSubCategories = objClsBLSubCategoryAssignment.getSubCategories();
         if (dsAdminSubCategories.Tables[0].Rows.Count >= 1)
         {
             lbAvailableAdminSubCategories.DataSource     = dsAdminSubCategories.Tables[0];
             lbAvailableAdminSubCategories.DataValueField = dsAdminSubCategories.Tables[0].Columns["SubCategoryID"].ToString();
             lbAvailableAdminSubCategories.DataTextField  = dsAdminSubCategories.Tables[0].Columns["SubCategory"].ToString();
             lbAvailableAdminSubCategories.DataBind();
         }
         if (dsAdminSubCategories.Tables[1].Rows.Count >= 1)
         {
             lbAvailableITSubCategories.DataSource     = dsAdminSubCategories.Tables[1];
             lbAvailableITSubCategories.DataValueField = dsAdminSubCategories.Tables[1].Columns["SubCategoryID"].ToString();
             lbAvailableITSubCategories.DataTextField  = dsAdminSubCategories.Tables[1].Columns["SubCategory"].ToString();
             lbAvailableITSubCategories.DataBind();
         }
         if (dsAdminSubCategories.Tables[2].Rows.Count >= 1)
         {
             lbAvailableHRSubCategories.DataSource     = dsAdminSubCategories.Tables[2];
             lbAvailableHRSubCategories.DataValueField = dsAdminSubCategories.Tables[2].Columns["SubCategoryID"].ToString();
             lbAvailableHRSubCategories.DataTextField  = dsAdminSubCategories.Tables[2].Columns["SubCategory"].ToString();
             lbAvailableHRSubCategories.DataBind();
         }
     }
     catch (V2Exceptions ex)
     {
         throw;
     }
     catch (System.Exception ex)
     {
         FileLog objFileLog = FileLog.GetLogger();
         objFileLog.WriteLine(LogType.Error, ex.Message, "SubCategoryAssignment.aspx", "bindSubCategories", ex.StackTrace);
         throw new V2Exceptions(ex.ToString(), ex);
     }
 }
        public DataSet FindNoOfCategory(clsSubCategoryAssignment objSubCategoryAssignment)
        {
            try
            {
                SqlParameter[] sqlParams = new SqlParameter[1];
                sqlParams[0]           = new SqlParameter("@EmployeeId", SqlDbType.Int, 4);
                sqlParams[0].Value     = objSubCategoryAssignment.EmployeeID;
                sqlParams[0].Direction = ParameterDirection.Input;
                DataSet dsGetData = SqlHelper.ExecuteDataset(strConnectionString, CommandType.StoredProcedure, "sp_FindtNoOfActiveCategory", sqlParams);
                return(dsGetData);
            }
            catch (V2Exceptions ex)
            {
                throw;
            }

            catch (System.Exception ex)
            {
                FileLog objFileLog = FileLog.GetLogger();
                objFileLog.WriteLine(LogType.Error, ex.Message, "clsDLSubCategoryAssignment.cs", "FindNoOfCategory", ex.StackTrace);
                throw new V2Exceptions();
            }
        }
        public string getEmployeeEmailID(clsSubCategoryAssignment objClsSubCategoryAssignment)
        {
            try
            {
                SqlParameter[] sqlParams = new SqlParameter[1];
                sqlParams[0]           = new SqlParameter("@EmployeeID", SqlDbType.Int, 4);
                sqlParams[0].Value     = objClsSubCategoryAssignment.EmployeeID;
                sqlParams[0].Direction = ParameterDirection.Input;
                string strEmployeeEmailID = (SqlHelper.ExecuteScalar(strConnectionString, CommandType.StoredProcedure, "sp_getEmployeeEmailID", sqlParams)).ToString();
                return(strEmployeeEmailID);
            }
            catch (V2Exceptions ex)
            {
                throw;
            }

            catch (System.Exception ex)
            {
                FileLog objFileLog = FileLog.GetLogger();
                objFileLog.WriteLine(LogType.Error, ex.Message, "clsDLSubCategoryAssignment.cs", "getEmployeeEmailID", ex.StackTrace);
                throw new V2Exceptions();
            }
        }
        public DataSet getAddSubCategory(clsSubCategoryAssignment objClsSubCategoryAssignment)
        {
            try
            {
                //SqlParameter[] sqlParams = new SqlParameter[1];
                //sqlParams[0] = new SqlParameter("@EmployeeId", SqlDbType.Int, 4);
                //sqlParams[0].Value = objClsSubCategoryAssignment.SuerAdminEmployeeId;
                //sqlParams[0].Direction = ParameterDirection.Input;
                DataSet dsSubCategories = SqlHelper.ExecuteDataset(strConnectionString, CommandType.StoredProcedure, "sp_BindSubCategoryForAssignMentNew");
                return(dsSubCategories);
            }
            catch (V2Exceptions ex)
            {
                throw;
            }

            catch (System.Exception ex)
            {
                FileLog objFileLog = FileLog.GetLogger();
                objFileLog.WriteLine(LogType.Error, ex.Message, "clsDLSubCategoryAssignment.cs", "getAddSubCategory", ex.StackTrace);
                throw new V2Exceptions();
            }
        }
 private void InsertEmployee()
 {
     try
     {
         clsSubCategoryAssignment   objClsSubCategoryAssignment   = new clsSubCategoryAssignment();
         clsBLSubCategoryAssignment objClsBLSubCategoryAssignment = new clsBLSubCategoryAssignment();
         objClsSubCategoryAssignment.EmployeeID = Convert.ToInt32(ddlEmployeeName.SelectedItem.Value);
         string strEmployeeEmailID = objClsBLSubCategoryAssignment.getEmployeeEmailID(objClsSubCategoryAssignment);
         objClsSubCategoryAssignment.EmployeeEmailID = strEmployeeEmailID;
         objClsSubCategoryAssignment.EmployeeName    = ddlEmployeeName.SelectedItem.Text;
         objClsSubCategoryAssignment.IsActive        = 1;
         objClsBLSubCategoryAssignment.InsertEmployee(objClsSubCategoryAssignment);
     }
     catch (V2Exceptions ex)
     {
         throw;
     }
     catch (System.Exception ex)
     {
         FileLog objFileLog = FileLog.GetLogger();
         objFileLog.WriteLine(LogType.Error, ex.Message, "SubCategoryAssignment.aspx", "InsertEmployee", ex.StackTrace);
         throw new V2Exceptions(ex.ToString(), ex);
     }
 }
        public void bindData(clsSubCategoryAssignment objSubCategoryAssignment)
        {
            try
            {
                dsGetData = objBLSubCategoryAssignment.getDetialOfEmployee(objSubCategoryAssignment);
                RepSubCategory.DataSource = dsGetData.Tables[0];

                NoOfTable = dsGetData.Tables[0].Rows.Count;
                if (dsGetData.Tables[0].Rows.Count > 0)
                {
                    lblEmployeeName.Text = dsGetData.Tables[0].Rows[i][1].ToString();
                }
                RepSubCategory.DataBind();

                #region Commented Old Code

                //			dsGetData = objBLSubCategoryAssignment.getDetialOfEmployee(objSubCategoryAssignment);
                //			RepSubCategory.DataBind();
                //			//int i=0;
                //			int NoOfTable=dsGetData.Tables[0].Rows.Count;
                //			//lblEmployeeName.Text=dsGetData.Tables[0].Rows[i][0].ToString();
                //			if(dsGetData.Tables[0].Rows.Count>0)
                //			{
                //				lblEmployeeName.Text=dsGetData.Tables[0].Rows[i][1].ToString();
                //			}
                //			for(i=0;i<dsGetData.Tables[NoOfTable].Rows.Count;i++)
                //			{
                //				if(k<=NoOfTable)
                //				{
                //					if(dsGetData.Tables[0].Rows[i][4].ToString()=="Admin")
                //					{
                //						//lblSuperAdminforAdmin.Visible=true;
                //						if(dsGetData.Tables[0].Rows[i][3].ToString()=="True")
                //						{
                //							//lblSuperAdminforAdmin.Text=SuperUserForAdmin+ "(Super Admin)";
                //						}
                //						for(int j=0;j<dsGetData.Tables[k].Rows.Count;j++)
                //						{
                //							//	lblForAdmin.Visible=true;
                //							subCategoryAdmin=subCategoryAdmin+"</br>"+dsGetData.Tables[k].Rows[j][0].ToString();
                //							//	lblForAdmin.Text=subCategoryAdmin.Replace("<br>","/r/n");
                //						}
                //					}
                //					else if(dsGetData.Tables[0].Rows[i][4].ToString()=="HR")
                //					{
                //						//lblSuperAdminforHR.Visible=true;
                //						if(dsGetData.Tables[0].Rows[i][3].ToString()=="True")
                //						{
                //							//	lblSuperAdminforHR.Text=SuperUserForHR+ "(Super Admin)";
                //						}
                //						for(int j=0;j<dsGetData.Tables[k].Rows.Count;j++)
                //						{
                //							//	lblForHR.Visible=true;
                //							subCategoryHR=subCategoryHR+"</br>"+dsGetData.Tables[k].Rows[j][0].ToString();
                //							//lblForHR.Text=subCategoryHR.Replace("<br>","/r/n");
                //						}
                //					}
                //					else if(dsGetData.Tables[0].Rows[i][4].ToString()=="IT")
                //					{
                //						//lblSuperAdminforIt.Visible=true;
                //						if(dsGetData.Tables[0].Rows[i][3].ToString()=="True")
                //						{
                //							//	lblSuperAdminforIt.Text=SuperUserForIT+ "(Super Admin)";
                //						}
                //						for(int j=0;j<dsGetData.Tables[k].Rows.Count;j++)
                //						{
                //							//	lblForIt.Visible=true;
                //							subCategoryIt=subCategoryIt +"</br>"+dsGetData.Tables[k].Rows[j][0].ToString();
                //							//	lblForIt.Text=subCategoryIt.Replace("<br>","/r/n");
                //						}
                //					}
                //					k++;
                //				}
                //			}

                #endregion Commented Old Code
            }
            catch (V2Exceptions ex)
            {
                throw;
            }
            catch (System.Exception ex)
            {
                FileLog objFileLog = FileLog.GetLogger();
                objFileLog.WriteLine(LogType.Error, ex.Message, "ViewCategoryEmpDetail.aspx", "bindData", ex.StackTrace);
                throw new V2Exceptions(ex.ToString(), ex);
            }
        }