Esempio n. 1
0
        private void FillMappedGroupDataToGrid()
        {
            objServicedb = new ServiceDB();
            DataTable dt          = new DataTable();
            string    strLogBcode = string.Empty;

            gvMappedGroups.Rows.Clear();
            try
            {
                dt = objServicedb.LevelServiceMappedGroupList_Get(CommonData.CompanyCode, CommonData.BranchCode, CommonData.StateCode).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);
                    }
                }
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.ToString());
            }
            finally
            {
                objServicedb = null;
                dt           = null;
            }
        }
        private void FillMappedDataToGrid()
        {
            objServicedb = new ServiceDB();
            string strLogBcode = string.Empty;

            gvMappedGroups.Rows.Clear();
            DataTable dt = objServicedb.LevelServiceMappedGroupList_Get(CommonData.CompanyCode, CommonData.BranchCode, CommonData.StateCode).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);

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

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

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