Exemplo n.º 1
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);
                }
            }
        }
Exemplo n.º 2
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);
                }
            }
        }