Пример #1
0
        private void FillBranchComboBox(string strStateCode)
        {
            objData = new StaffLevel();
            try
            {
                DataTable dt = objData.GetStateBranchesDS(CommonData.CompanyCode, strStateCode, CommonData.BranchCode).Tables[0];

                if (dt.Rows.Count > 0)
                {
                    //DataRow dr = dt.NewRow();
                    //dr[0] = "--Select--";
                    //dr[1] = "--Select--";
                    //dt.Rows.InsertAt(dr, 0);

                    cbBranches.DataSource    = dt;
                    cbBranches.DisplayMember = "branch_name";
                    cbBranches.ValueMember   = "branch_code";
                }
                cbBranches.SelectedValue = CommonData.BranchCode;
                dt = null;
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message, "Group To Destination", MessageBoxButtons.OK, MessageBoxIcon.Error);
            }
            finally
            {
                objData = null;
            }
        }
Пример #2
0
 private void FillLogicalBranchComboBox()
 {
     objData = new StaffLevel();
     try
     {
         DataTable dt = objData.LevelsLogicalBranchList_Get(cbBranches.SelectedValue.ToString()).Tables[0];
         DataRow   dr = dt.NewRow();
         dr[0] = "--Select--";
         dr[1] = "--Select--";
         dt.Rows.InsertAt(dr, 0);
         if (dt.Rows.Count > 1)
         {
             cbLogcalBranch.DataSource    = dt;
             cbLogcalBranch.DisplayMember = "Lbranch_name";
             cbLogcalBranch.ValueMember   = "Lbranch_code";
         }
         dt = null;
     }
     catch (Exception ex)
     {
         MessageBox.Show(ex.Message, "Group To Destination", MessageBoxButtons.OK, MessageBoxIcon.Error);
     }
     finally
     {
         objData = null;
     }
 }
Пример #3
0
        private void FillBranchComboBox(string strStateCode)
        {
            objData = new StaffLevel();
            try
            {
                DataTable dt = objData.LevelCompanyBranches_Proc(cbCompany.SelectedValue.ToString(), "BR").Tables[0];
                cbBranches.DataSource = null;
                cbBranches.Items.Clear();
                DataRow dr = dt.NewRow();
                dr[0] = "Select";
                dr[1] = "Select";
                dt.Rows.InsertAt(dr, 0);
                if (dt.Rows.Count > 0)
                {
                    cbBranches.DataSource    = dt;
                    cbBranches.DisplayMember = "branch_name";
                    cbBranches.ValueMember   = "branch_code";
                    cbBranches.SelectedValue = CommonData.BranchCode;
                }

                dt = null;
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message, "Camp To BR-Head Above", MessageBoxButtons.OK, MessageBoxIcon.Error);
            }
            finally
            {
                objData = null;
            }
        }
Пример #4
0
        private void FillStateComboBox()
        {
            objData = new StaffLevel();
            try
            {
                DataTable dt = objData.GetStatesDS().Tables[0];

                if (dt.Rows.Count > 1)
                {
                    cbStates.DataSource    = dt;
                    cbStates.DisplayMember = "State";
                    cbStates.ValueMember   = "CDState";
                }
                cbStates.SelectedValue = CommonData.StateCode;
                cbStates.Enabled       = false;
                dt = null;
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message, "Group To Destination", MessageBoxButtons.OK, MessageBoxIcon.Error);
            }
            finally
            {
                objData = null;
            }
        }
Пример #5
0
        public override Guid Insert(StaffLevel entity)
        {
            var g = base.Insert(entity);

            LevelModel.Load();
            return(g);
        }
        private void FillBranchComboBox(string strStateCode)
        {
            objData = new StaffLevel();
            try
            {
                strStateCode = cbStates.SelectedValue.ToString();
                DataTable dt = objData.GetStateBranchesDS(CommonData.CompanyCode, strStateCode, CommonData.BranchCode).Tables[0];

                if (dt.Rows.Count > 0)
                {
                    DataRow dr = dt.NewRow();
                    dr[0] = "Select";
                    dr[1] = "Select";
                    dt.Rows.InsertAt(dr, 0);

                    cbBranches.DataSource    = dt;
                    cbBranches.DisplayMember = "branch_name";
                    cbBranches.ValueMember   = "branch_code";
                }
                cbBranches.SelectedValue = CommonData.BranchCode;
                dt = null;
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message);
            }
            finally
            {
                objData = 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;
            }
        }
        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;
            }
        }
 private void FillCampComboBox()
 {
     objData = new StaffLevel();
     try
     {
         DataTable dt = objData.LevelCampList_Get("T").Tables[0];
         DataRow   dr = dt.NewRow();
         dr[0] = "--Select--";
         dr[1] = "--Select--";
         dt.Rows.InsertAt(dr, 0);
         if (dt.Rows.Count > 1)
         {
             cbGroupCamp.DataSource    = dt;
             cbGroupCamp.DisplayMember = "CAMP_NAME";
             cbGroupCamp.ValueMember   = "CAMP_CODE";
         }
         dt = null;
     }
     catch (Exception ex)
     {
         MessageBox.Show(ex.Message, "Source To Destination", MessageBoxButtons.OK, MessageBoxIcon.Error);
     }
     finally
     {
         objData = null;
     }
 }
Пример #10
0
 private void FillGroupDetailMappedData(int intRow)
 {
     if (intRow >= 0)
     {
         objData = new StaffLevel();
         string   strLogBcode = string.Empty;
         string[] strDestCode = gvMappedGroups.Rows[intRow].Cells["ecode"].Value.ToString().Split('~');
         try
         {
             clbDestination.Items.Clear();
             DataTable dt = objData.LevelGroupDetailEcodesMapped_Get(CommonData.CompanyCode, cbStates.SelectedValue.ToString(), cbBranches.SelectedValue.ToString(), Convert.ToInt32(strDestCode[1]), Convert.ToInt32(strDestCode[0]), strLogBcode).Tables[0];
             if (dt.Rows.Count > 0)
             {
                 foreach (DataRow dataRow in dt.Rows)
                 {
                     if (dataRow["mapped"].ToString() == "999999")
                     {
                         NewCheckboxListItem oclBox = new NewCheckboxListItem();
                         oclBox.Tag  = dataRow["ECODE"].ToString();
                         oclBox.Text = dataRow["ENAME"].ToString();
                         clbDestination.Items.Add(oclBox, false);
                         oclBox = null;
                     }
                     else
                     {
                         NewCheckboxListItem oclBox = new NewCheckboxListItem();
                         oclBox.Tag  = dataRow["ECODE"].ToString();
                         oclBox.Text = dataRow["ENAME"].ToString();
                         clbDestination.Items.Add(oclBox, true);
                         oclBox = null;
                     }
                 }
             }
             dt = null;
         }
         catch (Exception ex)
         {
             MessageBox.Show(ex.Message, "Group To Destination", MessageBoxButtons.OK, MessageBoxIcon.Error);
         }
         finally
         {
             objData = null;
         }
     }
 }
        private void FillBranchList()
        {
            objUtil = new UtilityDB();
            DataTable dt = null;

            //string sqlText = "";
            try
            {
                if (strRep == "STOCKPOINT_DC" || strRep == "STOCKPOINT_DCST" || strRep == "STOCKPOINT_GRN" || strRep == "STOCK_REC" || strRep == "STOCK_SUMMARY" || strRep == "STOCK_LEDGER" || strRep == "STOCKPOINT_RECONSILATION" || strRep == "SP_PENDING_DC")
                {
                    dt = objUtil.UserBranch(CommonData.LogUserId, "SP");
                }
                else if (strRep == "VEHICLE_LOAN" || strRep == "VEHICLE_INFO" || strRep == "SALES_STAFF_ALL" || strRep == "SaleSummaryBulletin" || strRep == "SERVICE_CONSOLIDATION")
                {
                    dt = objUtil.UserBranch(CommonData.LogUserId, "BR");
                }
                else
                {
                    dt = objUtil.dtUserBranch(CommonData.LogUserId);
                }
                clbGLList.Items.Clear();
                foreach (DataRow dataRow in dt.Rows)
                {
                    if (dataRow["branch_Code"] + "" != "")
                    {
                        NewCheckboxListItem oclBox = new NewCheckboxListItem();
                        oclBox.Tag  = dataRow["branch_Code"].ToString();
                        oclBox.Text = dataRow["branch_name"].ToString();
                        clbGLList.Items.Add(oclBox);
                        oclBox = null;
                    }
                }
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message);
            }
            finally
            {
                objStfLvl = null;
            }
        }
Пример #12
0
 private void frmDocuments_Load(object sender, EventArgs e)
 {
     objData = new StaffLevel();
     UtilityLibrary.PopulateControl(cmbDocument, objData.GetDocuments().Tables[0].DefaultView, 0, 1, "--PLEASE SELECT--", 0);
     objData       = null;
     dtpDate.Value = System.DateTime.Now;
     if (drs != null)
     {
         cmbDocument.Text = drs[0][1].ToString();
         if (Convert.ToBoolean(drs[0][2]) == false)
         {
             cbRecieved.SelectedIndex = 2;
         }
         else
         {
             cbRecieved.SelectedIndex = 1;
         }
         dtpDate.Value   = Convert.ToDateTime(drs[0][3]);
         txtRemarks.Text = drs[0][4].ToString();
     }
 }
Пример #13
0
        private int DeleteMappedData()
        {
            string[] strArrDestCode = null;
            int      nDelete        = 0;

            objDA   = new SQLDB();
            objData = new StaffLevel();
            string strDelete = "";

            try
            {
                for (int row = 0; row < gvMappedGroups.Rows.Count; row++)
                {
                    if (clbDestination.Items.Count > 0)
                    {
                        string strSCodes = gvMappedGroups.Rows[row].Cells["ecode"].Value.ToString();
                        strArrDestCode = strSCodes.Split('~');

                        strDelete += " DELETE from LevelGroup_map_Detl " +
                                     "WHERE lgmd_company_code='" + cbCompany.SelectedValue.ToString() +
                                     "' AND lgmd_branch_code='" + cbBranches.SelectedValue.ToString() +
                                     "' AND lgmd_doc_month='" + CommonData.DocMonth.ToString().ToUpper() +
                                     "' AND lgmd_group_ecode=" + strArrDestCode[0] +
                                     " AND lgmd_map_type='HO';";
                    }
                }
                nDelete = objDA.ExecuteSaveData(strDelete);
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message);
            }
            finally
            {
                objDA = null;
            }
            return(nDelete);
        }
Пример #14
0
        private void fillGridMappedData()
        {
            string strLogBcode = string.Empty;

            objData = new StaffLevel();
            gvMappedGroups.Rows.Clear();
            DataTable dt = objData.LevelMappedGroupList_Get(CommonData.CompanyCode, CommonData.StateCode, CommonData.BranchCode).Tables[0];

            if (dt.Rows.Count > 0)
            {
                for (int i = 0; i < dt.Rows.Count; i++)
                {
                    DataGridViewRow tempRow = new DataGridViewRow();

                    DataGridViewCell cellECODE = new DataGridViewTextBoxCell();
                    cellECODE.Value = dt.Rows[i]["ECODE"];
                    tempRow.Cells.Add(cellECODE);

                    DataGridViewCell cellGROUPName = new DataGridViewTextBoxCell();
                    cellGROUPName.Value = dt.Rows[i]["GroupName"];
                    tempRow.Cells.Add(cellGROUPName);

                    DataGridViewCell cellGroupEname = new DataGridViewTextBoxCell();
                    cellGroupEname.Value = dt.Rows[i]["ENAME"];
                    tempRow.Cells.Add(cellGroupEname);

                    DataGridViewCell celllogBranchCode = new DataGridViewTextBoxCell();
                    celllogBranchCode.Value = dt.Rows[i]["logBranchCode"];
                    tempRow.Cells.Add(celllogBranchCode);

                    DataGridViewCell cellLogicalBranch = new DataGridViewTextBoxCell();
                    cellLogicalBranch.Value = dt.Rows[i]["logBranchName"];
                    tempRow.Cells.Add(cellLogicalBranch);

                    gvMappedGroups.Rows.Add(tempRow);
                }
            }
        }
Пример #15
0
 private void FillStateComboBox()
 {
     objState = new StaffLevel();
     try
     {
         DataTable dt = objState.GetStatesDS().Tables[0];
         if (dt.Rows.Count > 1)
         {
             cbStates.DataSource    = dt;
             cbStates.DisplayMember = "State";
             cbStates.ValueMember   = "CDState";
         }
         dt = null;
     }
     catch (Exception ex)
     {
         MessageBox.Show(ex.Message);
     }
     finally
     {
         objState = null;
     }
 }
Пример #16
0
        private void EcodeSearch()
        {
            objInvoiceDB = new InvoiceDB();
            DataSet dsEmp = null;

            try
            {
                Cursor.Current     = Cursors.WaitCursor;
                cbEcode.DataSource = null;
                cbEcode.Items.Clear();
                dsEmp = objInvoiceDB.OrderSheetIssueEcodeSearch_Get(CommonData.CompanyCode, CommonData.BranchCode, CommonData.DocMonth, txtEcodeSearch.Text.ToString());
                DataTable dtEmp = dsEmp.Tables[0];
                if (dtEmp.Rows.Count > 0)
                {
                    cbEcode.DataSource    = dtEmp;
                    cbEcode.DisplayMember = "ENAME";
                    cbEcode.ValueMember   = "ECODE";
                }
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message);
            }
            finally
            {
                if (cbEcode.SelectedIndex > -1)
                {
                    cbEcode.SelectedIndex = 0;
                    strECode = ((System.Data.DataRowView)(cbEcode.SelectedItem)).Row.ItemArray[0].ToString();
                }
                objData        = null;
                Cursor.Current = Cursors.Default;
            }

            //objInvoiceDB = new InvoiceDB();
            //objDA = new SQLDB();
            //DataSet dsEmp = null;
            //string sqlText = "";
            //try
            //{
            //    sqlText = "SELECT ECODE,MEMBER_NAME ENAME FROM EORA_MASTER WHERE ECODE LIKE '%"+txtEcodeSearch.Text.ToString()+"%' AND BRANCH_CODE = '"+CommonData.BranchCode+"';";
            //    Cursor.Current = Cursors.WaitCursor;
            //    cbEcode.DataSource = null;
            //    cbEcode.Items.Clear();
            //    //dsEmp = objInvoiceDB.InvLevelEcodeSearch_Get(CommonData.CompanyCode, CommonData.BranchCode, CommonData.DocMonth, txtEcodeSearch.Text.ToString());
            //    dsEmp = objDA.ExecuteDataSet(sqlText);
            //    DataTable dtEmp = dsEmp.Tables[0];
            //    if (dtEmp.Rows.Count > 0)
            //    {
            //        cbEcode.DataSource = dtEmp;
            //        cbEcode.DisplayMember = "ENAME";
            //        cbEcode.ValueMember = "ECODE";
            //    }
            //}
            //catch (Exception ex)
            //{
            //    MessageBox.Show(ex.Message);
            //}
            //finally
            //{
            //    if (cbEcode.SelectedIndex > -1)
            //    {
            //        cbEcode.SelectedIndex = 0;
            //        strECode = ((System.Data.DataRowView)(cbEcode.SelectedItem)).Row.ItemArray[0].ToString();
            //    }
            //    objInvoiceDB = null;
            //    Cursor.Current = Cursors.Default;
            //}
        }
Пример #17
0
        private void fillGridMappedData()
        {
            //string strBcode = string.Empty;
            //objData = new StaffLevel();
            //gvMappedGroups.Rows.Clear();
            //if (cbBranches.SelectedIndex>0)
            //strBcode = cbBranches.SelectedValue.ToString();
            //DataTable dt = objData.LevelMappedGroupList_Get(cbCompany.SelectedValue.ToString(), CommonData.StateCode, cbBranches.SelectedValue.ToString()).Tables[0];
            ////DataTable dt = objData.LevelGroupAboveBranchList(cbCompany.SelectedValue.ToString(), CommonData.StateCode, strBcode).Tables[0];
            ////DataTable dt = objData.LevelGroupAboveBranchListGet(cbCompany.SelectedValue.ToString(), CommonData.StateCode, strBcode, "").Tables[0];
            //if (dt.Rows.Count > 0)
            //{
            //    for (int i = 0; i < dt.Rows.Count; i++)
            //    {
            //        DataGridViewRow tempRow = new DataGridViewRow();

            //        DataGridViewCell cellECODE = new DataGridViewTextBoxCell();
            //        cellECODE.Value = dt.Rows[i]["ECODE"];
            //        tempRow.Cells.Add(cellECODE);

            //        DataGridViewCell cellBRANCHName = new DataGridViewTextBoxCell();
            //        cellBRANCHName.Value = dt.Rows[i]["BRANCH_NAME"];
            //        tempRow.Cells.Add(cellBRANCHName);

            //        DataGridViewCell cellHEADEname = new DataGridViewTextBoxCell();
            //        cellHEADEname.Value = dt.Rows[i]["ENAME"];
            //        tempRow.Cells.Add(cellHEADEname);

            //        DataGridViewCell cellBranchCode = new DataGridViewTextBoxCell();
            //        cellBranchCode.Value = dt.Rows[i]["BRANCH_CODE"];
            //        tempRow.Cells.Add(cellBranchCode);

            //        //DataGridViewCell cellLogicalBranch = new DataGridViewTextBoxCell();
            //        //cellLogicalBranch.Value = dt.Rows[i]["logBranchName"];
            //        //tempRow.Cells.Add(cellLogicalBranch);

            //        gvMappedGroups.Rows.Add(tempRow);

            //    }
            //}
            string strLogBcode = string.Empty;

            objData = new StaffLevel();
            gvMappedGroups.Rows.Clear();
            DataTable dt = objData.LevelMappedGroupList_Get(cbCompany.SelectedValue.ToString(), cbBranches.SelectedValue.ToString().Substring(3, 2), cbBranches.SelectedValue.ToString()).Tables[0];

            if (dt.Rows.Count > 0)
            {
                for (int i = 0; i < dt.Rows.Count; i++)
                {
                    DataGridViewRow tempRow = new DataGridViewRow();

                    DataGridViewCell cellECODE = new DataGridViewTextBoxCell();
                    cellECODE.Value = dt.Rows[i]["ECODE"];
                    tempRow.Cells.Add(cellECODE);

                    DataGridViewCell cellGROUPName = new DataGridViewTextBoxCell();
                    cellGROUPName.Value = dt.Rows[i]["GroupName"] + "";
                    tempRow.Cells.Add(cellGROUPName);

                    DataGridViewCell cellGroupEname = new DataGridViewTextBoxCell();
                    cellGroupEname.Value = dt.Rows[i]["ENAME"] + "";
                    tempRow.Cells.Add(cellGroupEname);

                    DataGridViewCell celllogBranchCode = new DataGridViewTextBoxCell();
                    celllogBranchCode.Value = dt.Rows[i]["logBranchCode"] + "";
                    tempRow.Cells.Add(celllogBranchCode);

                    DataGridViewCell cellLogicalBranch = new DataGridViewTextBoxCell();
                    cellLogicalBranch.Value = dt.Rows[i]["logBranchName"] + "";
                    tempRow.Cells.Add(cellLogicalBranch);

                    gvMappedGroups.Rows.Add(tempRow);
                }
            }
        }