private void FillCampGroups(string CompCode, string BranCode, string DocMonth)
        {
            objSQLdb = new SQLDB();
            DataTable dt = new DataTable();

            clbCamps.Items.Clear();
            try
            {
                dt = GetServiceCampGroups(CompCode, BranCode, DocMonth).Tables[0];

                if (dt.Rows.Count > 0)
                {
                    foreach (DataRow item in dt.Rows)
                    {
                        NewCheckboxListItem oclBox = new NewCheckboxListItem();
                        oclBox.Tag  = item["lgm_group_name"].ToString();
                        oclBox.Text = item["lgm_group_name"].ToString();
                        clbCamps.Items.Add(oclBox);
                        oclBox = null;
                    }
                }
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.ToString());
            }
            finally
            {
                objSQLdb = null;
                dt       = null;
            }
        }
Ejemplo n.º 2
0
        private void GetFilesInFolder(string sPath)
        {
            clbFiles.Items.Clear();
            string folder = sPath;

            if (sPath.Length > 1)
            {
                //@"C:\\Program Files\\RS Solution\\Realsoft 8.8\\McDataFiles";
                var files = Directory.GetFiles(folder, "*.dat", SearchOption.AllDirectories);
                if (files != null)
                {
                    foreach (string file in files)
                    {
                        string fname = Path.GetFileNameWithoutExtension(file);
                        if (fname.Length < 9)
                        {
                            //string sDate = fname.Substring(0, 2) + "-" + fname.Substring(2, 2) + "-" + fname.Substring(4, 2);
                            //DateTime dtPunchDate = Convert.ToDateTime(sDate);
                            NewCheckboxListItem oclBox = new NewCheckboxListItem();
                            oclBox.Tag  = Path.GetFileName(file);
                            oclBox.Text = Path.GetFileName(file);
                            clbFiles.Items.Add(oclBox);
                            oclBox = null;
                        }
                    }
                }
            }
        }
        private void FillActivityTypes(string CategoryCode)
        {
            objSQLdb = new SQLDB();
            DataTable dt     = new DataTable();
            string    strCmd = "";

            clbActivityTypes.Items.Clear();
            try
            {
                strCmd = "SELECT DISTINCT SAM_ACTIVITY_SHORT_NAME ActivityName " +
                         " FROM SERVICES_ACTIVITIES_MAS " +
                         "INNER JOIN SERVICES_TNA ON TNA_ACTIVITY_ID=SAM_ACTIVITY_ID " +
                         " where SAM_CATEGORY_ID in (" + CategoryCode + ") ";
                dt = objSQLdb.ExecuteDataSet(strCmd).Tables[0];

                if (dt.Rows.Count > 0)
                {
                    foreach (DataRow item in dt.Rows)
                    {
                        NewCheckboxListItem oclBox = new NewCheckboxListItem();
                        oclBox.Tag  = item["ActivityName"].ToString();
                        oclBox.Text = item["ActivityName"].ToString();
                        clbActivityTypes.Items.Add(oclBox);
                        oclBox = null;
                    }
                }
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.ToString());
            }
        }
        private void FillGroupMappedSourceDataGrid(int intRow)
        {
            objServicedb = new ServiceDB();
            DataTable dt             = new DataTable();
            string    strLogBcode    = string.Empty;
            string    strLoadedEcode = string.Empty;

            string[] strLvlEcode = gvMappedGroups.Rows[intRow].Cells["ecode"].Value.ToString().Split('~');
            cbGroupCamp.Text = gvMappedGroups.Rows[intRow].Cells["GroupName"].Value.ToString();
            clbSource.Items.Clear();

            try
            {
                dt = objServicedb.ServiceLevelGroupEcodeMapped_Get(CommonData.CompanyCode, cbBranches.SelectedValue.ToString(), cbStates.SelectedValue.ToString(), Convert.ToInt32(strLvlEcode[1]), Convert.ToInt32(strLvlEcode[0]), strLogBcode).Tables[0];
                if (dt.Rows.Count > 0)
                {
                    foreach (DataRow dataRow in dt.Rows)
                    {
                        if (dataRow["ENAME"].ToString().Trim().Length > 0)
                        {
                            if (dataRow["mapped"].ToString() == "999999")
                            {
                                NewCheckboxListItem oclBox = new NewCheckboxListItem();
                                oclBox.Tag  = dataRow["ECODE"].ToString();
                                oclBox.Text = dataRow["ENAME"].ToString();
                                clbSource.Items.Add(oclBox);
                                oclBox = null;
                            }
                            else
                            {
                                if (strLvlEcode[0].IndexOf(dataRow["ECODE"].ToString().Substring(0, dataRow["ECODE"].ToString().IndexOf("~"))) < 0)
                                {
                                    NewCheckboxListItem oclBox = new NewCheckboxListItem();
                                    oclBox.Tag  = dataRow["ECODE"].ToString();
                                    oclBox.Text = dataRow["ENAME"].ToString();
                                    if (!strLoadedEcode.Contains(dataRow["ECODE"].ToString()))
                                    {
                                        clbSource.Items.Add(oclBox, CheckState.Checked);
                                    }

                                    strLoadedEcode += dataRow["ECODE"].ToString() + ",";

                                    //clbSource.Items.Add(oclBox, CheckState.Checked);
                                    oclBox = null;
                                }
                            }
                        }
                    }
                }
                dt = null;
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message);
            }
            finally
            {
                objServicedb = null;
            }
        }
        private void FillGroupMappedSourceData(string strBCode, string strSCode)
        {
            objServicedb = new ServiceDB();
            DataTable dt = new DataTable();

            string strLogBcode    = string.Empty;
            string strLoadedEcode = string.Empty;

            string[] strDestCode = ((NewCheckboxListItem)(clbDestination.SelectedItem)).Tag.Split('~');

            clbSource.Items.Clear();
            try
            {
                dt = objServicedb.LevelGroupServiceEcodeMapped_Get(CommonData.CompanyCode, strBCode, strSCode, Convert.ToInt32(strDestCode[0]), Convert.ToInt32(cbLevels.SelectedValue.ToString()), strLogBcode).Tables[0];
                if (dt.Rows.Count > 0)
                {
                    foreach (DataRow dataRow in dt.Rows)
                    {
                        if (dataRow["mapped"].ToString() == "999999")
                        {
                            cbGroupCamp.Text    = dataRow["GroupName"].ToString();
                            cbLogcalBranch.Text = dataRow["logBranchName"].ToString();
                            NewCheckboxListItem oclBox = new NewCheckboxListItem();
                            oclBox.Tag  = dataRow["ECODE"].ToString();
                            oclBox.Text = dataRow["ENAME"].ToString();
                            clbSource.Items.Add(oclBox);
                            oclBox = null;
                        }
                        else
                        {
                            if (strDestCode[0].IndexOf(dataRow["ECODE"].ToString().Substring(0, dataRow["ECODE"].ToString().IndexOf("~"))) < 0)
                            {
                                cbGroupCamp.Text    = dataRow["GroupName"].ToString();
                                cbLogcalBranch.Text = dataRow["logBranchName"].ToString();
                                NewCheckboxListItem oclBox = new NewCheckboxListItem();
                                oclBox.Tag  = dataRow["ECODE"].ToString();
                                oclBox.Text = dataRow["ENAME"].ToString();
                                if (!strLoadedEcode.Contains(dataRow["ECODE"].ToString()))
                                {
                                    clbSource.Items.Add(oclBox, CheckState.Checked);
                                }

                                strLoadedEcode += dataRow["ECODE"].ToString() + ",";
                                //clbSource.Items.Add(oclBox, CheckState.Checked);
                                oclBox = null;
                            }
                        }
                    }
                }
                dt = null;
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message);
            }
            finally
            {
                objServicedb = null;
            }
        }
        private void FillUserCompanyData()
        {
            objSQLDB = new SQLDB();
            DataTable dt = new DataTable();

            //string strCommand = "";
            clbCompany.Items.Clear();
            try
            {
                dt = Get_UserCompanyBranchFilterCursor("", CommonData.LogUserId, "", "PARENT").Tables[0];

                if (dt.Rows.Count > 0)
                {
                    foreach (DataRow item in dt.Rows)
                    {
                        NewCheckboxListItem oclBox = new NewCheckboxListItem();
                        oclBox.Tag  = item["COMPANY_CODE"].ToString();
                        oclBox.Text = item["COMPANY_NAME"].ToString();
                        clbCompany.Items.Add(oclBox);
                        oclBox = null;
                    }
                }
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.ToString());
            }
        }
        private void FillGLList()
        {
            objStfLvl = new StaffLevel();
            DataTable dt = null;

            try
            {
                dt = objStfLvl.BranchGLList_Get(CommonData.CompanyCode, CommonData.BranchCode, Convert.ToDateTime(dtpDate.Value).ToString("MMMyyyy")).Tables[0];
                clbGLList.Items.Clear();
                foreach (DataRow dataRow in dt.Rows)
                {
                    if (dataRow["ECODE"] + "" != "")
                    {
                        NewCheckboxListItem oclBox = new NewCheckboxListItem();
                        oclBox.Tag  = dataRow["ECODE"].ToString();
                        oclBox.Text = dataRow["ENAME"].ToString();
                        clbGLList.Items.Add(oclBox);
                        oclBox = null;
                    }
                }
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message);
            }
            finally
            {
                objStfLvl = null;
            }
        }
Ejemplo n.º 8
0
        private void FillBranchGroupData()
        {
            IndentDB objIndent = new IndentDB();

            try
            {
                cbGroup.DataSource = null;
                cbGroup.Items.Clear();
                DataTable dtGroup = objIndent.IndentGroupList_Get(CommonData.CompanyCode.ToString(), CommonData.BranchCode, CommonData.DocMonth).Tables[0];
                if (dtGroup.Rows.Count > 0)
                {
                    foreach (DataRow dataRow in dtGroup.Rows)
                    {
                        NewCheckboxListItem oclBox = new NewCheckboxListItem();
                        string[]            ename  = dataRow["ENAME"].ToString().Split('~');
                        oclBox.Tag  = dataRow["ENAME"].ToString();
                        oclBox.Text = dataRow["GroupName"].ToString();
                        cbGroup.Items.Add(oclBox);
                        oclBox = null;
                    }
                }
                dtGroup = null;
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message);
            }
            finally
            {
                objIndent = null;
            }
        }
        private void FillEmployeeDetails(string strDevSlNo)
        {
            objSQLdb = new SQLDB();
            DataTable dt = new DataTable();

            try
            {
                dt = GetEmployeeDetails("", strBranCode, strDevSlNo, strFrmDate, strToDate, "").Tables[0];

                if (dt.Rows.Count > 0)
                {
                    foreach (DataRow dataRow in dt.Rows)
                    {
                        NewCheckboxListItem oclBox = new NewCheckboxListItem();
                        oclBox.Text = dataRow["DisplayMenber"].ToString();
                        oclBox.Tag  = dataRow["ValueMember"].ToString();

                        clbEmployees.Items.Add(oclBox);
                    }
                }
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.ToString());
            }
        }
Ejemplo n.º 10
0
        private void FillCompanyData()
        {
            objData = new SQLDB();
            DataTable dt = new DataTable();

            try
            {
                string strCommand = "SELECT DISTINCT(CM_COMPANY_NAME),CM_COMPANY_CODE FROM COMPANY_MAS WHERE CM_COMPANY_CODE in (SELECT DAMH_COMPANY_CODE FROM DL_APPL_MASTER_HEAD)";

                dt = objData.ExecuteDataSet(strCommand).Tables[0];
                if (dt.Rows.Count > 0)
                {
                    foreach (DataRow item in dt.Rows)
                    {
                        //clbCompany.Items.Add(item["CM_COMPANY_NAME"].ToString(), false);
                        NewCheckboxListItem oclBox = new NewCheckboxListItem();
                        oclBox.Tag  = item["CM_COMPANY_CODE"].ToString();
                        oclBox.Text = item["CM_COMPANY_NAME"].ToString();
                        clbCompany.Items.Add(oclBox);
                        oclBox = null;
                    }
                }
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.ToString());
            }
            finally
            {
                objData = null;
                dt      = null;
            }
        }
Ejemplo n.º 11
0
        private void FillEmployeeList()
        {
            objSQLdb = new SQLDB();
            DataTable dt     = new DataTable();
            string    strCmd = "";

            clbEmployees.Items.Clear();
            GetSelectedValues();
            if (Company.Length > 0 && Branches.Length > 3)
            {
                try
                {
                    strCmd = "exec Get_ServiceEmployeeList '" + Company + "','" + Branches + "', '" + dtpFrmDocMonth.Value.ToString("MMMyyyy").ToUpper() +
                             "', '" + dtpToDocMonth.Value.ToString("MMMyyyy").ToUpper() + "'";
                    dt = objSQLdb.ExecuteDataSet(strCmd).Tables[0];
                    if (dt.Rows.Count > 0)
                    {
                        foreach (DataRow item in dt.Rows)
                        {
                            NewCheckboxListItem oclBox = new NewCheckboxListItem();
                            oclBox.Tag  = item["Ecode"].ToString();
                            oclBox.Text = item["EmpName"].ToString();
                            clbEmployees.Items.Add(oclBox);
                            oclBox = null;
                        }
                    }
                }
                catch (Exception ex)
                {
                    MessageBox.Show(ex.ToString());
                }
            }
        }
        private void FillDesignationsData(string strDeptCode)
        {
            objSQLdb = new SQLDB();
            DataTable dt = new DataTable();

            try
            {
                string strCmd = "SELECT DISTINCT(desig_name), desig_code FROM DESIG_MAS " +
                                " WHERE CAST(dept_code AS VARCHAR)IN(" + strDeptCode + ") ORDER BY desig_name";
                dt = objSQLdb.ExecuteDataSet(strCmd).Tables[0];
                if (dt.Rows.Count > 0)
                {
                    foreach (DataRow dataRow in dt.Rows)
                    {
                        NewCheckboxListItem oclBox = new NewCheckboxListItem();
                        oclBox.Text = dataRow["desig_name"].ToString();
                        oclBox.Tag  = dataRow["desig_code"].ToString();

                        clbDesigs.Items.Add(oclBox);
                        oclBox = null;
                    }
                }
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.ToString());
            }
            finally
            {
                objSQLdb = null;
                dt       = null;
            }
        }
        private void FillDepartmentData()
        {
            objSQLdb = new SQLDB();
            DataTable dt = new DataTable();

            clbDesigs.Items.Clear();
            try
            {
                string strCommand = "SELECT DISTINCT dept_name,dept_code FROM Dept_Mas ORDER BY dept_name";
                dt = objSQLdb.ExecuteDataSet(strCommand).Tables[0];

                if (dt.Rows.Count > 0)
                {
                    foreach (DataRow dataRow in dt.Rows)
                    {
                        NewCheckboxListItem oclBox = new NewCheckboxListItem();
                        oclBox.Text = dataRow["dept_name"].ToString();
                        oclBox.Tag  = dataRow["dept_code"].ToString();

                        clbDepartments.Items.Add(oclBox);
                    }
                }
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.ToString());
            }
            finally
            {
                objSQLdb = null;
                dt       = null;
            }
        }
        private void FillIndentCompanyData()
        {
            objSQLDB = new SQLDB();
            DataTable dt = new DataTable();

            //string strCommand = "";
            clbCompany.Items.Clear();
            try
            {
                dt = Get_IndentCompanyBranchFilterCursor(Convert.ToInt32(txtIndentNo.Text), FinYear, "PARENT").Tables[0];

                if (dt.Rows.Count > 0)
                {
                    foreach (DataRow item in dt.Rows)
                    {
                        NewCheckboxListItem oclBox = new NewCheckboxListItem();
                        oclBox.Tag  = item["SIH_COMPANY_CODE"].ToString();
                        oclBox.Text = item["COMPANY_NAME"].ToString();
                        //clbCompany.Items.Add(oclBox);
                        clbCompany.Items.Add(oclBox, CheckState.Checked);
                        oclBox = null;
                    }
                }
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.ToString());
            }
        }
Ejemplo n.º 15
0
        private void FillDestinationComboBox(int nLevelId)
        {
            objServicedb = new ServiceDB();
            DataTable dt = new DataTable();

            clbDestination.Items.Clear();
            GetUserBranches();
            try
            {
                dt = objServicedb.EcodesForService_Get(strBranch, nLevelId, "").Tables[0];
                if (dt.Rows.Count > 0)
                {
                    foreach (DataRow dataRow in dt.Rows)
                    {
                        NewCheckboxListItem oclBox = new NewCheckboxListItem();
                        oclBox.Tag  = dataRow["ECODE"].ToString();
                        oclBox.Text = dataRow["Ename"].ToString();

                        clbDestination.Items.Add(oclBox);

                        oclBox = null;
                    }
                }
                dt = null;
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message);
            }
            finally
            {
                objServicedb = null;
            }
        }
Ejemplo n.º 16
0
        private void FillBranchData()
        {
            IndentDB objIndent = new IndentDB();

            try
            {
                DataTable dtBranch = objIndent.IndentStockPointList_Get(CommonData.CompanyCode.ToString()).Tables[0];
                if (dtBranch.Rows.Count > 0)
                {
                    foreach (DataRow dataRow in dtBranch.Rows)
                    {
                        NewCheckboxListItem oclBox = new NewCheckboxListItem();
                        oclBox.Tag  = dataRow["branch_code"].ToString();
                        oclBox.Text = dataRow["branch_name"].ToString();
                        cbBranches.Items.Add(oclBox);
                        oclBox = null;
                    }
                }
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message);
            }
            finally
            {
                if (cbBranches.SelectedIndex > -1)
                {
                    strBranchCode = ((System.Data.DataRowView)(cbBranches.SelectedItem)).Row.ItemArray[0].ToString();
                    FillBranchGroupData();
                }
                objIndent = null;
            }
        }
Ejemplo n.º 17
0
        private void FillUsers()
        {
            objMaster = new Master();
            DataTable dt = null;

            try
            {
                dt = objMaster.UserMasterList_Get(CommonData.CompanyCode, CommonData.BranchCode).Tables[0];

                foreach (DataRow dataRow in dt.Rows)
                {
                    if (dataRow["UM_USER_ID"] + "" != "")
                    {
                        NewCheckboxListItem oclBox = new NewCheckboxListItem();
                        oclBox.Tag  = dataRow["UM_USER_ID"].ToString();
                        oclBox.Text = dataRow["UM_USER_NAME"].ToString() + " ( " + dataRow["UM_USER_ID"].ToString() + " )";
                        clbUsers.Items.Add(oclBox);
                        oclBox = null;
                    }
                }
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message);
            }
            finally
            {
                objMaster = null;
            }
        }
        private void FillMappedSourceECodes()
        {
            DataTable dt = null;

            objStaffLevel = new StaffLevel();
            clbdlinkSource.Items.Clear();
            try
            {
                dt = objStaffLevel.AboveBranchLeaders_InQ_Get(cbDocmonth.SelectedValue.ToString(), ((NewCheckboxListItem)(clbdlinkEmplist.SelectedItem)).Tag.ToString()).Tables[0];
                if (dt.Rows.Count > 0)
                {
                    foreach (DataRow dataRow in dt.Rows)
                    {
                        NewCheckboxListItem oclBox = new NewCheckboxListItem();
                        oclBox.Tag  = dataRow["xDest_ecode"].ToString();
                        oclBox.Text = dataRow["xDest_ecode"].ToString() + "-" + dataRow["xDest_eName"].ToString() + "-(" + dataRow["xDest_NoG"].ToString() + ")";
                        clbdlinkSource.Items.Add(oclBox);
                        oclBox = null;
                    }
                }
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.ToString());
            }
            finally
            {
                objStaffLevel = null;
                dt            = null;
            }
        }
Ejemplo n.º 19
0
        private void FillBranchData()
        {
            IndentDB objIndent = new IndentDB();

            try
            {
                DataTable dtBranch = objIndent.IndentStockPointList_Get(CommonData.CompanyCode.ToString()).Tables[0];
                DataRow   dr       = dtBranch.NewRow();
                dr[0] = "0";
                dr[1] = "Select";
                dtBranch.Rows.InsertAt(dr, 0);
                dr = null;
                if (dtBranch.Rows.Count > 0)
                {
                    foreach (DataRow dataRow in dtBranch.Rows)
                    {
                        NewCheckboxListItem oclBox = new NewCheckboxListItem();
                        oclBox.Tag  = dataRow["branch_code"].ToString();
                        oclBox.Text = dataRow["branch_name"].ToString();
                        cbBranches.Items.Add(oclBox);
                        oclBox = null;
                    }
                }
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message);
            }
            finally
            {
                objIndent = null;
            }
        }
Ejemplo n.º 20
0
        private void FillBranchData()
        {
            objSQLdb = new SQLDB();
            DataTable dt = new DataTable();

            try
            {
                string strCommand = "SELECT BRANCH_NAME,BRANCH_CODE FROM BRANCH_MAS" +
                                    " WHERE COMPANY_CODE='" + CommonData.CompanyCode +
                                    "' AND BRANCH_TYPE IN('BR')  ORDER BY BRANCH_NAME ";
                dt = objSQLdb.ExecuteDataSet(strCommand).Tables[0];

                if (dt.Rows.Count > 0)
                {
                    foreach (DataRow dataRow in dt.Rows)
                    {
                        NewCheckboxListItem oclBox = new NewCheckboxListItem();
                        oclBox.Text = dataRow["BRANCH_NAME"].ToString();
                        oclBox.Tag  = dataRow["BRANCH_CODE"].ToString();

                        clbBranches.Items.Add(oclBox);
                    }
                }
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.ToString());
            }
            finally
            {
                objSQLdb = null;
                dt       = null;
            }
        }
Ejemplo n.º 21
0
        private void FillAssets()
        {
            objSQLdb = new SQLDB();
            DataTable dt = new DataTable();

            try
            {
                string strCommand = "SELECT DISTINCT(FAH_ASSET_TYPE) FROM FIXED_ASSETS_HEAD ORDER BY FAH_ASSET_TYPE ASC;";
                dt = objSQLdb.ExecuteDataSet(strCommand).Tables[0];
                if (dt.Rows.Count > 0)
                {
                    foreach (DataRow dataRow in dt.Rows)
                    {
                        NewCheckboxListItem oclBox = new NewCheckboxListItem();
                        oclBox.Tag  = dataRow["FAH_ASSET_TYPE"].ToString();
                        oclBox.Text = dataRow["FAH_ASSET_TYPE"].ToString();
                        clbAssets.Items.Add(oclBox);
                        oclBox = null;
                    }
                }
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.ToString());
            }
            finally
            {
                objSQLdb = null;
                dt       = null;
            }
        }
        private void FillUserBranchData()
        {
            objData = new SQLDB();
            //string sqlText = "";
            DataTable dt = new DataTable();

            try
            {
                string strCommand = "SELECT UB_BRANCH_CODE ,BRANCH_NAME  FROM USER_BRANCH " +
                                    " INNER JOIN BRANCH_MAS ON UB_BRANCH_CODE=BRANCH_CODE WHERE UB_USER_ID='" + CommonData.LogUserId + "'";
                dt = objData.ExecuteDataSet(strCommand).Tables[0];

                if (dt.Rows.Count > 0)
                {
                    foreach (DataRow dataRow in dt.Rows)
                    {
                        if (dataRow["BRANCH_NAME"] + "" != "")
                        {
                            NewCheckboxListItem oclBox = new NewCheckboxListItem();
                            oclBox.Tag  = dataRow["UB_BRANCH_CODE"].ToString();
                            oclBox.Text = dataRow["BRANCH_NAME"].ToString();
                            cblBranchesList.Items.Add(oclBox);
                            oclBox = null;
                        }
                    }
                }
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.ToString());
            }
            finally
            {
                objData = null;
                dt      = null;
            }

            //objData = new SQLDB();
            //string sqlText = "";
            //DataTable dt = new DataTable();

            ////sqlText = "SELECT DISTINCT COMPANY_CODE FROM USER_BRANCH INNER JOIN BRANCH_MAS ON BRANCH_CODE = UB_BRANCH_CODE WHERE UB_USER_ID = '" + CommonData.LogUserId + "'";
            ////dt = objData.ExecuteDataSet(sqlText).Tables[0];
            ////if (dt.Rows.Count > 0)
            ////{
            ////    for (int i = 0; i < dt.Rows.Count; i++)
            ////    {
            ////        if (strComp != "")
            ////            strComp += ",";
            ////        strComp += dt.Rows[i]["COMPANY_CODE"].ToString();
            ////    }
            ////}
            ////else
            ////{
            ////    strComp += CommonData.CompanyCode.ToString();
            ////}
        }
Ejemplo n.º 23
0
        private void FillBranches(string strStates, string strType)
        {
            objSQLdb = new SQLDB();
            DataTable dt     = new DataTable();
            string    strCmd = "";

            clbbranch.Items.Clear();
            if (strStates.Length > 0)
            {
                try
                {
                    if (chkBrTypeAll.Checked == true)
                    {
                        strCmd = "SELECT DISTINCT BRANCH_NAME,BRANCH_CODE+'@'+STATE_CODE as BranchCode FROM USER_BRANCH  " +
                                 " INNER JOIN BRANCH_MAS ON BRANCH_CODE = UB_BRANCH_CODE " +
                                 " WHERE  UB_USER_ID ='" + CommonData.LogUserId +
                                 "' and STATE_CODE in (" + strStates + ") and ACTIVE='T' " +
                                 "  ORDER BY BRANCH_NAME ASC";
                    }
                    else
                    {
                        if (strType.Length > 0)
                        {
                            strCmd = "SELECT DISTINCT BRANCH_NAME,BRANCH_CODE+'@'+STATE_CODE as BranchCode FROM USER_BRANCH  " +
                                     " INNER JOIN BRANCH_MAS ON BRANCH_CODE = UB_BRANCH_CODE " +
                                     " WHERE  UB_USER_ID ='" + CommonData.LogUserId +
                                     "' and STATE_CODE in (" + strStates + ") and ACTIVE='T' " +
                                     " and BRANCH_TYPE IN (" + strBrType + ") ORDER BY BRANCH_NAME ASC";
                        }
                    }
                    if (strCmd.Length > 0)
                    {
                        dt = objSQLdb.ExecuteDataSet(strCmd).Tables[0];
                    }
                    if (dt.Rows.Count > 0)
                    {
                        foreach (DataRow dr in dt.Rows)
                        {
                            NewCheckboxListItem oclBox = new NewCheckboxListItem();
                            oclBox.Tag  = dr["BranchCode"].ToString();
                            oclBox.Text = dr["BRANCH_NAME"].ToString();
                            clbbranch.Items.Add(oclBox);
                            oclBox = null;
                        }
                    }
                }
                catch (Exception ex)
                {
                    MessageBox.Show(ex.ToString());
                }
                finally
                {
                    dt       = null;
                    objSQLdb = null;
                }
            }
        }
Ejemplo n.º 24
0
 private void btnAdd_Click(object sender, EventArgs e)
 {
     if (txtDestEName.Text.Trim().Length > 0)
     {
         if (txtSourceEname.Text.Trim().Length > 0)
         {
             objDB = new SQLDB();
             DataTable dt      = new DataTable();
             string    sqlText = "select * from LevelSource_Dest_mapping where lsd_source_ecode = " + txtSorceEcode.Text + " and lsd_doc_month = '" + cbDocmonth.Text + "'";
             try
             {
                 dt = objDB.ExecuteDataSet(sqlText).Tables[0];
                 if (dt.Rows.Count == 0)
                 {
                     for (int i = 0; i < clbSource.Items.Count; i++)
                     {
                         if (((SSAdmin.NewCheckboxListItem)(clbSource.Items[i])).Tag.ToString() == txtSorceEcode.Text + "^" + cmbSourceDesig.SelectedValue.ToString())
                         {
                             MessageBox.Show("Allready Added to list", "SSERP", MessageBoxButtons.OK, MessageBoxIcon.Error);
                             return;
                         }
                     }
                     NewCheckboxListItem oclBox = new NewCheckboxListItem();
                     oclBox.Tag  = txtSorceEcode.Text + "^" + cmbSourceDesig.SelectedValue.ToString();
                     oclBox.Text = txtSourceEname.Text;
                     clbSource.Items.Add(oclBox);
                     oclBox = null;
                     clbSource.SetItemCheckState(clbSource.Items.Count - 1, CheckState.Checked);
                 }
                 else
                 {
                     MessageBox.Show("Allready Mapped With " + dt.Rows[0]["lsd_dest_ecode"].ToString(), "SSERP", MessageBoxButtons.OK, MessageBoxIcon.Error);
                     return;
                 }
             }
             catch (Exception ex)
             {
                 MessageBox.Show(ex.ToString());
             }
             finally
             {
                 objDB = null;
             }
         }
         else
         {
             MessageBox.Show("Enter Source Employee Ecode", "", MessageBoxButtons.OK, MessageBoxIcon.Error);
         }
     }
     else
     {
         MessageBox.Show("Enter Destination Employee Ecode", "", MessageBoxButtons.OK, MessageBoxIcon.Error);
     }
 }
Ejemplo n.º 25
0
        /// <summary>
        /// Retrieves audio and subtitle streams through FFDShow
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void getFFDShowStreams_Click(object sender, EventArgs e)
        {
            this.audioStreamlistBox.ItemCheck    -= new System.Windows.Forms.ItemCheckEventHandler(this.audioStreamlistBox_ItemCheck);
            this.subtitleStreamlistBox.ItemCheck -= new System.Windows.Forms.ItemCheckEventHandler(this.subtitleStreamlistBox_ItemCheck);
            audioStreamlistBox.Items.Clear();
            subtitleStreamlistBox.Items.Clear();
            using (FFDShowAPI ffdshowAPI = new FFDShowAPI())
            {
                if (!ffdshowAPI.checkFFDShowActive())
                {
                    return;
                }
                SortedDictionary <int, FFDShowAPI.Stream> audioStreams    = ffdshowAPI.AudioStreams;
                SortedDictionary <int, FFDShowAPI.Stream> subtitleStreams = ffdshowAPI.SubtitleStreams;

                int currentAudioStream    = ffdshowAPI.AudioStream;
                int currentSubtitleStream = ffdshowAPI.SubtitleStream;

                foreach (KeyValuePair <int, FFDShowAPI.Stream> stream in audioStreams)
                {
                    NewCheckboxListItem chk = new NewCheckboxListItem();
                    chk.Text = stream.Value.name + "(" + stream.Value.languageName + ")";
                    chk.Tag  = stream.Key;
                    audioStreamlistBox.Items.Add(chk);
                    if (stream.Key == currentAudioStream)
                    {
                        audioStreamlistBox.SetItemChecked(audioStreamlistBox.Items.Count - 1, true);
                    }
                }

                foreach (KeyValuePair <int, FFDShowAPI.Stream> stream in subtitleStreams)
                {
                    NewCheckboxListItem chk = new NewCheckboxListItem();
                    chk.Text = stream.Value.name + "(" + stream.Value.languageName + ")";
                    chk.Tag  = stream.Key;
                    subtitleStreamlistBox.Items.Add(chk);
                    if (stream.Key == currentSubtitleStream)
                    {
                        subtitleStreamlistBox.SetItemChecked(subtitleStreamlistBox.Items.Count - 1, true);
                    }
                }
                subtitleStreamlistBox.Refresh();
                audioStreamlistBox.Refresh();
                tabControl1.SelectedTab               = tabPage3;
                this.audioStreamlistBox.ItemCheck    += new System.Windows.Forms.ItemCheckEventHandler(this.audioStreamlistBox_ItemCheck);
                this.subtitleStreamlistBox.ItemCheck += new System.Windows.Forms.ItemCheckEventHandler(this.subtitleStreamlistBox_ItemCheck);
            }
        }
Ejemplo n.º 26
0
        /// <summary>
        /// Switch of subtitle stream
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void subtitleStreamlistBox_ItemCheck(object sender, ItemCheckEventArgs e)
        {
            NewCheckboxListItem item = (NewCheckboxListItem)subtitleStreamlistBox.SelectedItem;
            int streamNb             = (int)item.Tag;

            using (FFDShowAPI ffdshowAPI = new FFDShowAPI())
            {
                if (!ffdshowAPI.checkFFDShowActive())
                {
                    return;
                }
                SortedDictionary <int, FFDShowAPI.Stream> subtitleStreams = ffdshowAPI.SubtitleStreams;
                ffdshowAPI.SubtitleStream = streamNb;
                getFFDShowStreams_Click(null, null);
            }
        }
        private void FillActualTrainerDetails()
        {
            objSQLdb = new SQLDB();
            DataTable dt = new DataTable();

            clbPrograms.Items.Clear();
            string strCommand = "";

            try
            {
                strCommand = "SELECT  DISTINCT(CAST(HTAH_TRAINER_ECODE AS VARCHAR)+'-'+MEMBER_NAME) EmpName " +
                             ", HTAH_TRAINER_ECODE EmpEcode " +
                             " FROM HR_TRAINING_ACTUAL_HEAD " +
                             " inner JOIN EORA_MASTER ON ECODE=HTAH_TRAINER_ECODE " +
                             " WHERE HTAH_TRAINER_FLAG='INTERNAL' " +
                             " and HTAH_ACTUAL_PROGRAM_FROM_DATE BETWEEN '" + dtpFromdate.Value.ToString("dd/MMM/yyyy") +
                             "' AND '" + dtpToDate.Value.ToString("dd/MMM/yyyy") + "' ORDER BY EmpName asc";

                if (strCommand.Length > 5)
                {
                    dt = objSQLdb.ExecuteDataSet(strCommand).Tables[0];
                }

                if (dt.Rows.Count > 0)
                {
                    chkAllPrgs.Visible = true;
                    btnReport.Enabled  = true;
                    foreach (DataRow dataRow in dt.Rows)
                    {
                        NewCheckboxListItem oclBox = new NewCheckboxListItem();
                        oclBox.Text = dataRow["EmpName"].ToString();
                        oclBox.Tag  = dataRow["EmpEcode"].ToString();

                        clbPrograms.Items.Add(oclBox);
                        oclBox = null;
                    }
                }
                else
                {
                    btnReport.Enabled = false;
                }
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.ToString());
            }
        }
Ejemplo n.º 28
0
        private void GetMappedData()
        {
            objDB = new SQLDB();
            DataTable dt = new DataTable();

            clbSource.Items.Clear();
            try
            {
                string sqlText = "SELECT " +
                                 "lsd_doc_month," +
                                 "lsd_source_desig_id," +
                                 "lsd_source_elevel_id," +
                                 "lsd_source_ecode," +
                                 "CAST(ES.ECODE AS VARCHAR)+'-'+ES.MEMBER_NAME+'-('+ES.DESIG+')' lsd_source_ename," +
                                 "lsd_dest_desig_id," +
                                 "lsd_dest_elevel_id," +
                                 "lsd_dest_ecode," +
                                 "CAST(ED.ECODE AS VARCHAR)+'-'+ED.MEMBER_NAME+'-('+ED.DESIG+')' lsd_dest_ename " +
                                 "from LevelSource_Dest_mapping " +
                                 "INNER JOIN EORA_MASTER ES ON ES.ECODE = lsd_source_ecode " +
                                 "INNER JOIN EORA_MASTER ED ON ED.ECODE = lsd_dest_ecode " +
                                 "WHERE lsd_dest_ecode = " + txtDestEcode.Text + " AND lsd_doc_month = '" + cbDocmonth.SelectedValue.ToString() + "'";
                dt = objDB.ExecuteDataSet(sqlText).Tables[0];
                if (dt.Rows.Count > 0)
                {
                    cmbDestDesig.SelectedValue = dt.Rows[0]["lsd_dest_desig_id"].ToString() + "^" + dt.Rows[0]["lsd_dest_elevel_id"].ToString();
                    foreach (DataRow dataRow in dt.Rows)
                    {
                        NewCheckboxListItem oclBox = new NewCheckboxListItem();
                        oclBox.Tag  = dataRow["lsd_source_ecode"].ToString() + "^" + dataRow["lsd_source_desig_id"].ToString() + "^" + dataRow["lsd_source_elevel_id"].ToString();
                        oclBox.Text = dataRow["lsd_source_ename"].ToString();
                        clbSource.Items.Add(oclBox);
                        oclBox = null;
                        clbSource.SetItemCheckState(clbSource.Items.Count - 1, CheckState.Checked);
                    }
                }
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.ToString());
            }
            finally
            {
                dt    = null;
                objDB = null;
            }
        }
Ejemplo n.º 29
0
        private void FillStates(string sCmp)
        {
            //string[] sCmps
            DataTable dt = null;

            objData = new SQLDB();
            string strCmd = "";

            clbState.Items.Clear();
            strChkState    = "";
            strChkDistrict = "";
            if (sCmp.Length > 0)
            {
                sCmp   = sCmp.Remove(sCmp.Length - 1);
                strCmd = "SELECT DISTINCT(DAMH_FIRM_HEAD_STATE),BM.STATE_CODE StateCode FROM DL_APPL_MASTER_HEAD INNER JOIN BRANCH_MAS BM ON STATE = DAMH_FIRM_HEAD_STATE WHERE DAMH_COMPANY_CODE IN(" + sCmp + ")";
            }
            //else
            //{
            //    //strCmd = " SELECT  DISTINCT(STATE) FROM BRANCH_MAS WHERE BRANCH_CODE in(SELECT damh_branch_code FROM DL_APPL_MASTER_HEAD)";
            //    strCmd = "SELECT DISTINCT(DAMH_FIRM_HEAD_STATE),BM.STATE_CODE StateCode FROM DL_APPL_MASTER_HEAD INNER JOIN BRANCH_MAS BM ON STATE = DAMH_FIRM_HEAD_STATE";
            //}
            try
            {
                dt = objData.ExecuteDataSet(strCmd).Tables[0];
                if (dt.Rows.Count > 0)
                {
                    foreach (DataRow item in dt.Rows)
                    {
                        NewCheckboxListItem oclBox = new NewCheckboxListItem();
                        oclBox.Tag  = item["DAMH_FIRM_HEAD_STATE"].ToString();
                        oclBox.Text = item["DAMH_FIRM_HEAD_STATE"].ToString();
                        clbState.Items.Add(oclBox);
                        oclBox = null;
                    }
                }
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.ToString());
            }
            finally
            {
                objData = null;
                dt      = null;
            }
        }
        private void FillSourceComboBox()
        {
            objAuditdb = new AuditDB();
            DataTable dt = new DataTable();

            string[] strDestCode = ((NewCheckboxListItem)(clbDestination.SelectedItem)).Tag.Split('~');
            clbSource.Items.Clear();

            try
            {
                dt = objAuditdb.LevelGroupAuditEcodes_Get(Convert.ToInt32(strDestCode[0]), Convert.ToDateTime(dtpDocMonth.Value).ToString("MMMyyyy").ToUpper()).Tables[0];

                if (dt.Rows.Count > 0)
                {
                    foreach (DataRow dataRow in dt.Rows)
                    {
                        if (dataRow["Mapped"].ToString() == "99999")
                        {
                            NewCheckboxListItem oclBox = new NewCheckboxListItem();
                            oclBox.Tag  = dataRow["ECODE"].ToString();
                            oclBox.Text = dataRow["ENAME"].ToString();
                            clbSource.Items.Add(oclBox);
                            oclBox = null;
                        }
                        else
                        {
                            NewCheckboxListItem oclBox = new NewCheckboxListItem();
                            oclBox.Tag  = dataRow["ECODE"].ToString();
                            oclBox.Text = dataRow["ENAME"].ToString();

                            clbSource.Items.Add(oclBox, CheckState.Checked);
                            oclBox = null;
                        }
                    }
                }
                dt = null;
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message);
            }
            finally
            {
                objAuditdb = null;
            }
        }
Ejemplo n.º 31
0
        /// <summary>
        /// Retrieves audio and subtitle streams through FFDShow
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void getFFDShowStreams_Click(object sender, EventArgs e)
        {
            this.audioStreamlistBox.ItemCheck -= new System.Windows.Forms.ItemCheckEventHandler(this.audioStreamlistBox_ItemCheck);
            this.subtitleStreamlistBox.ItemCheck -= new System.Windows.Forms.ItemCheckEventHandler(this.subtitleStreamlistBox_ItemCheck);
            audioStreamlistBox.Items.Clear();
            subtitleStreamlistBox.Items.Clear();
            using (FFDShowAPI ffdshowAPI = new FFDShowAPI())
            {
                if (!ffdshowAPI.checkFFDShowActive()) return;
                SortedDictionary<int, FFDShowAPI.Stream> audioStreams = ffdshowAPI.AudioStreams;
                SortedDictionary<int, FFDShowAPI.Stream> subtitleStreams = ffdshowAPI.SubtitleStreams;

                int currentAudioStream = ffdshowAPI.AudioStream;
                int currentSubtitleStream = ffdshowAPI.SubtitleStream;

                foreach (KeyValuePair<int,FFDShowAPI.Stream> stream in audioStreams)
                {
                    NewCheckboxListItem chk = new NewCheckboxListItem();
                    chk.Text = stream.Value.name + "(" + stream.Value.languageName + ")";
                    chk.Tag = stream.Key;
                    audioStreamlistBox.Items.Add(chk);
                    if (stream.Key == currentAudioStream)
                    {
                        audioStreamlistBox.SetItemChecked(audioStreamlistBox.Items.Count - 1, true);
                    }
                }

                foreach (KeyValuePair<int, FFDShowAPI.Stream> stream in subtitleStreams)
                {
                    NewCheckboxListItem chk = new NewCheckboxListItem();
                    chk.Text = stream.Value.name + "(" + stream.Value.languageName + ")";
                    chk.Tag = stream.Key;
                    subtitleStreamlistBox.Items.Add(chk);
                    if (stream.Key == currentSubtitleStream)
                    {
                        subtitleStreamlistBox.SetItemChecked(subtitleStreamlistBox.Items.Count-1, true);
                    }
                }
                subtitleStreamlistBox.Refresh();
                audioStreamlistBox.Refresh();
                tabControl1.SelectedTab = tabPage3;
                this.audioStreamlistBox.ItemCheck += new System.Windows.Forms.ItemCheckEventHandler(this.audioStreamlistBox_ItemCheck);
                this.subtitleStreamlistBox.ItemCheck += new System.Windows.Forms.ItemCheckEventHandler(this.subtitleStreamlistBox_ItemCheck);
            }
        }