Exemple #1
0
        public void LoadBuildingByOfficeID(UltraCombo cbo, int OfficeID)
        {
            //string str = BLLObj.LoadBuildingfromOfficesEdit(OfficeID);
            //dt = GlobalVaribles.DeserializeDataTable(str);
            //cbo.DataSource = dt;
            //cbo.ValueMember = "BuildingID";
            //cbo.DisplayMember = "BuildingName";
            //cbo.DisplayLayout.Bands[0].Columns["BuildingID"].Hidden = true;
            //cbo.DisplayLayout.AutoFitStyle = AutoFitStyle.ResizeAllColumns;
            //cbo.Value = OfficeID;
            // cbo.ReadOnly = true;


            string str = BLLObj.LoadAllBuildingforOffice();

            dt = GlobalVaribles.DeserializeDataTable(str);
            //sqlDataAdapter.Fill(dataTable);
            cbo.DataSource    = dt;
            cbo.ValueMember   = "BuildingID";
            cbo.DisplayMember = "BuildingName";
            cbo.DisplayLayout.Bands[0].Columns["BuildingID"].Hidden = true;
            cbo.DisplayLayout.AutoFitStyle = AutoFitStyle.ResizeAllColumns;

            string strr = BLLObj.LoadBuildingfromOfficesEdit(OfficeID);

            dt        = new DataTable();
            dt        = GlobalVaribles.DeserializeDataTable(strr);
            cbo.Value = Convert.ToInt32(dt.Rows[0]["BuildingID"].ToString());
            //cbo.Value = 0;
        }
Exemple #2
0
        public void LoadBuildingByFloorID(UltraCombo cbo, int floorID)
        {
            string str = BLLObj_Building.LoadAllBuildingCombo();

            dt = GlobalVaribles.DeserializeDataTable(str);
            //sqlDataAdapter.Fill(dataTable);
            cbo.DataSource    = dt;
            cbo.ValueMember   = "BuildingID";
            cbo.DisplayMember = "BuildingName";
            cbo.DisplayLayout.Bands[0].Columns["BuildingID"].Hidden = true;
            cbo.DisplayLayout.AutoFitStyle = AutoFitStyle.ResizeAllColumns;

            string strr = BLLObj.LoadBuildingIDByFloorID(floorID);

            dt = new DataTable();
            dt = GlobalVaribles.DeserializeDataTable(strr);

            cbo.Value = Convert.ToInt32(dt.Rows[0]["BuildingID"]);


            //cbo.DataSource = dt;
            //cbo.ValueMember = "BuildingID";
            //cbo.DisplayMember = "BuildingName";
            //cbo.DisplayLayout.Bands[0].Columns["BuildingID"].Hidden = true;
            //cbo.DisplayLayout.AutoFitStyle = AutoFitStyle.ResizeAllColumns;
            //cbo.Value = floorID;
            // cbo.ReadOnly = true;
        }
Exemple #3
0
        private void btnOfficeID_Click(object sender, EventArgs e)
        {
            object rValue;

            try
            {
                string str = BLLObj.LoadAllOffices();
                GlobalVaribles.dtGSearch = GlobalVaribles.DeserializeDataTable(str);
                rValue = FrmGSearch.Show("Select", false, "All Office");
                if (rValue == null)
                {
                    return;
                }
                Moffice = long.Parse(rValue.ToString());
                DataTable dt   = new DataTable();
                string    strs = BLLObj.GetOfficeByID(Convert.ToInt32(Moffice));
                dt = GlobalVaribles.DeserializeDataTable(strs);

                if (dt != null && dt.Rows.Count > 0)
                {
                    UpdateRecord = true;
                    GetRecord    = true;
                    // LoadBuildingByFloorID(cboBuildingName, Convert.ToInt32(Moffice));
                    LoadBuildingByOfficeID(cboBuildingName, Convert.ToInt32(Moffice));
                    LoadfloorByOfficeIDinEdit(cboFloorName, Convert.ToInt32(Moffice));
                    //string strr = BLLObj.LoadBuildingfromOfficesEdit(Convert.ToInt32(Moffice));
                    //dt = new DataTable();
                    //dt = GlobalVaribles.DeserializeDataTable(strr);
                    //LoadfloorByBuildingIDinEdit(cboFloorName,Convert.ToInt32(dt.Rows[0]["BuildingID"].ToString()));
                    //  cbo.Value = Convert.ToInt32(dt.Rows[0]["BuildingID"].ToString());

                    //LoadfloorByBuildingID(cboFloorName, BuildingID);

                    //  LoadfloorByBuildingID(cboFloorName, BuildingID);
                    txtOfficeID.Text           = dt.Rows[0]["OfficeID"].ToString();
                    txtofficeName.Text         = dt.Rows[0]["OfficeName"].ToString();
                    txttenantName.Text         = dt.Rows[0]["TenantName"].ToString();
                    txtRent.Text               = dt.Rows[0]["OfficeRent"].ToString();
                    txtOfficeArea.Text         = dt.Rows[0]["OfficeAreaSquareFoot"].ToString();
                    txtElectricityPerUnit.Text = dt.Rows[0]["ElectricityPerUnit"].ToString();
                    txtGeneratorPerUnit.Text   = dt.Rows[0]["GeneratorPerUnit"].ToString();
                    txtMaintence.Text          = dt.Rows[0]["Maintenance"].ToString();
                    txtwater.Text              = dt.Rows[0]["Water"].ToString();
                    txtOther.Text              = dt.Rows[0]["Other"].ToString();
                    txtDescription.Text        = dt.Rows[0]["Description"].ToString();

                    chkIsActive.CheckedValue = bool.Parse(dt.Rows[0]["Status"].ToString());
                    btnEdit.Enabled          = true;
                    btnOK.Enabled            = false;
                }
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message, GlobalVaribles.ProjectName, MessageBoxButtons.OK, MessageBoxIcon.Stop);
            }
        }
Exemple #4
0
 public void GetMaxCityID()
 {
     MCityID = BLLObj.GetMaxCityID();
     dt      = GlobalVaribles.DeserializeDataTable(MCityID);
     if (dt.Rows.Count > 0)
     {
         MCity          = long.Parse(dt.Rows[0]["CityID"].ToString());
         txtCityID.Text = MCity.ToString();
     }
 }
 public void GetMaxBuildingID()
 {
     MBuildingID = BLLObj.GetMaxBuildingID();
     dt          = GlobalVaribles.DeserializeDataTable(MBuildingID);
     if (dt.Rows.Count > 0)
     {
         MBuilding          = long.Parse(dt.Rows[0]["BuildingID"].ToString());
         txtBuildingID.Text = MBuilding.ToString();
     }
 }
Exemple #6
0
 public void GetMaxOfficeID()
 {
     MOfficeID = BLLObj.GetMaxOfficeID();
     dt        = GlobalVaribles.DeserializeDataTable(MOfficeID);
     if (dt.Rows.Count > 0)
     {
         Moffice          = long.Parse(dt.Rows[0]["OfficeID"].ToString());
         txtOfficeID.Text = Moffice.ToString();
     }
 }
Exemple #7
0
 public void GetMaxFloorID()
 {
     MFloorID = BLLObj.GetMaxFloorID();
     dt       = GlobalVaribles.DeserializeDataTable(MFloorID);
     if (dt.Rows.Count > 0)
     {
         Mfloor          = long.Parse(dt.Rows[0]["FloorID"].ToString());
         txtFloorID.Text = Mfloor.ToString();
     }
 }
        //private long GetMaxUserId()
        //{
        //    long MaxID;
        //    try
        //    {
        //        MaxID = DataAccess.GetMaxNO("UserID", "Users");
        //    }
        //    catch (Exception ex)
        //    {
        //        throw ex;
        //    }
        //    return MaxID;
        //}

        public void GetMaxUserID()
        {
            MUserID = BLLObj.GetMaxUserID();
            dt      = GlobalVaribles.DeserializeDataTable(MUserID);
            if (dt.Rows.Count > 0)
            {
                MUser          = long.Parse(dt.Rows[0]["UserID"].ToString());
                lblUserID.Text = MUser.ToString();
                // txtCityID.Text = MUser.ToString();
            }
        }
Exemple #9
0
 public void GetMaxBillingID()
 {
     MOfficeID = BLLObj.GetMaxBillID();
     dt        = GlobalVaribles.DeserializeDataTable(MOfficeID);
     if (dt.Rows.Count > 0)
     {
         MBilling          = long.Parse(dt.Rows[0]["BillingID"].ToString());
         txtBillingID.Text = MBilling.ToString();
         BillingID         = Convert.ToInt32(dt.Rows[0]["BillingID"].ToString());
         txtBillNo.Text    = Convert.ToString("Invoice Number " + BillingID);
     }
 }
Exemple #10
0
        private void btnBillID_Click(object sender, EventArgs e)
        {
            object rValue;

            try
            {
                string str = BLLObj.LoadAllBillgSearchOnClickButton();
                GlobalVaribles.dtGSearch = GlobalVaribles.DeserializeDataTable(str);
                rValue = FrmGSearch.Show("Select", false, "All Billing");
                if (rValue == null)
                {
                    return;
                }
                MBilling = long.Parse(rValue.ToString());
                DataTable dt   = new DataTable();
                string    strs = BLLObj.GetBillingByID(Convert.ToInt32(MBilling));
                dt = GlobalVaribles.DeserializeDataTable(strs);

                if (dt != null && dt.Rows.Count > 0)
                {
                    UpdateRecord                  = true;
                    GetRecord                     = true;
                    txtBillingID.Text             = dt.Rows[0]["BillingID"].ToString();
                    txtBillNo.Text                = dt.Rows[0]["BillNumber"].ToString();
                    dtpBillDate.Value             = Convert.ToDateTime(dt.Rows[0]["BillDate"].ToString());
                    cboOfficeName.Value           = Convert.ToInt32(dt.Rows[0]["OfficeID"].ToString());
                    txtPrevElectUnit.Text         = dt.Rows[0]["PrevElectricityUnit"].ToString();
                    TxtCurrElecUnit.Text          = dt.Rows[0]["CurrentElectricityUnit"].ToString();
                    txtthisMonthElectricUnit.Text = dt.Rows[0]["ThisMonthElectricityUnit"].ToString();
                    txtPrevGenetorUnit.Text       = dt.Rows[0]["PrevGeneratorUnit"].ToString();
                    txtCurrGeneratorUnit.Text     = dt.Rows[0]["CurrentGeneratorUnit"].ToString();
                    txtThisMonthGenetorUnit.Text  = dt.Rows[0]["ThisMonthGeneratorUnit"].ToString();
                    txtElectricityBill.Text       = dt.Rows[0]["ElectricityBill"].ToString();
                    txtGenetorBill.Text           = dt.Rows[0]["GenetorBill"].ToString();
                    txtWithOutTaxBill.Text        = dt.Rows[0]["BillWithOutTax"].ToString();
                    txtTax.Text                   = dt.Rows[0]["Tax"].ToString();
                    txtTotalBillWithTax.Text      = dt.Rows[0]["TotalBillWithTax"].ToString();
                    txtDiscount.Text              = dt.Rows[0]["Discount"].ToString();
                    txtReceivedAmount.Text        = dt.Rows[0]["RecievedAmount"].ToString();
                    txtArears.Text                = dt.Rows[0]["Arears"].ToString();
                    //LoadBuildingByOfficeID(cboBuildingName, Convert.ToInt32(Moffice));
                    //LoadfloorByOfficeIDinEdit(cboFloorName, Convert.ToInt32(Moffice));

                    chkIsActive.CheckedValue = bool.Parse(dt.Rows[0]["Status"].ToString());
                    btnEdit.Enabled          = true;
                    btnOK.Enabled            = false;
                }
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message, GlobalVaribles.ProjectName, MessageBoxButtons.OK, MessageBoxIcon.Stop);
            }
        }
Exemple #11
0
        public void LoadAllBuilding(UltraCombo cbo)
        {
            string str = BLLObj_Building.LoadAllBuilding();

            dt = GlobalVaribles.DeserializeDataTable(str);
            //sqlDataAdapter.Fill(dataTable);
            cbo.DataSource    = dt;
            cbo.ValueMember   = "BuildingID";
            cbo.DisplayMember = "BuildingName";
            cbo.DisplayLayout.Bands[0].Columns["BuildingID"].Hidden = true;
            cbo.DisplayLayout.AutoFitStyle = AutoFitStyle.ResizeAllColumns;
            cbo.Value = 0;
        }
Exemple #12
0
        public void LoadfloorByBuildingID(UltraCombo cbo, int BuildingID)
        {
            string str = BLLObj.LoadfloorByBuildingID(BuildingID);

            dt = GlobalVaribles.DeserializeDataTable(str);
            if (dt != null && dt.Rows.Count > 0)
            {
                cbo.DataSource    = dt;
                cbo.ValueMember   = "FloorID";
                cbo.DisplayMember = "FloorName";
                cbo.DisplayLayout.Bands[0].Columns["FloorID"].Hidden = true;
                cbo.DisplayLayout.AutoFitStyle = AutoFitStyle.ResizeAllColumns;
                cbo.Value = BuildingID;
            }

            // cbo.ReadOnly = true;
        }
Exemple #13
0
 public void LoadOfficesForBilling(UltraCombo cbo)
 {
     try
     {
         string str = BLLObj.LoadOfficesForBilling();
         dt = GlobalVaribles.DeserializeDataTable(str);
         //sqlDataAdapter.Fill(dataTable);
         cbo.DataSource    = dt;
         cbo.ValueMember   = "OfficeID";
         cbo.DisplayMember = "OfficeName";
         cbo.DisplayLayout.Bands[0].Columns["OfficeID"].Hidden = true;
         cbo.DisplayLayout.AutoFitStyle = AutoFitStyle.ResizeAllColumns;
         cbo.Value = 0;
     }
     catch (Exception)
     {
         //throw;
     }
 }
Exemple #14
0
        bool DuplicationCheck()
        {
            bool      IsDuplicate = false;
            string    str         = BLLObj.DuplicationCheck(txtofficeName.Text);
            DataTable dtduplicate = GlobalVaribles.DeserializeDataTable(str);

            if (dtduplicate != null)
            {
                if (dtduplicate.Rows.Count > 0)
                {
                    FrmMessage message = new FrmMessage("Error Code: SA-0010 \n Error Message: Failed to update. \nSame record already exists in the system.", 1);
                    message.ShowDialog();
                    IsDuplicate = true;
                }
                else
                {
                    IsDuplicate = false;
                }
            }
            return(IsDuplicate);
        }
Exemple #15
0
        private void btnBuildingID_Click(object sender, EventArgs e)
        {
            object rValue;

            try
            {
                string str = BLLObj.LoadAllBuilding();

                GlobalVaribles.dtGSearch = GlobalVaribles.DeserializeDataTable(str);

                rValue = FrmGSearch.Show("Select", false, "All Building");
                if (rValue == null)
                {
                    return;
                }
                MBuilding = long.Parse(rValue.ToString());
                DataTable dt = new DataTable();
                // GetCityIDByCityValue(Convert.ToInt32(MCity));
                string strs = BLLObj.GetBuildingByID(Convert.ToInt32(MBuilding));
                dt = GlobalVaribles.DeserializeDataTable(strs);

                if (dt != null && dt.Rows.Count > 0)
                {
                    UpdateRecord = true;
                    GetRecord    = true;
                    LoadCityByBuildingID(cboCityName, Convert.ToInt32(MBuilding));

                    txtBuildingID.Text       = dt.Rows[0]["BuildingID"].ToString();
                    txtBuildingName.Text     = dt.Rows[0]["BuildingName"].ToString();
                    txtAddress.Text          = dt.Rows[0]["Address"].ToString();
                    chkIsActive.CheckedValue = bool.Parse(dt.Rows[0]["Status"].ToString());
                    btnEdit.Enabled          = true;
                    btnOK.Enabled            = false;
                }
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message, GlobalVaribles.ProjectName, MessageBoxButtons.OK, MessageBoxIcon.Stop);
            }
        }
Exemple #16
0
        public void LoadfloorByOfficeIDinEdit(UltraCombo cbo, int OfficeID)
        {
            BuildingID = Convert.ToInt32(cboBuildingName.Value);
            string str = BLLObj.LoadfloorByBuildingID(BuildingID);

            dt = GlobalVaribles.DeserializeDataTable(str);
            if (dt != null && dt.Rows.Count > 0)
            {
                cbo.DataSource    = dt;
                cbo.ValueMember   = "FloorID";
                cbo.DisplayMember = "FloorName";
                cbo.DisplayLayout.Bands[0].Columns["FloorID"].Hidden = true;
                cbo.DisplayLayout.AutoFitStyle = AutoFitStyle.ResizeAllColumns;
                //cbo.Value = BuildingID;
            }

            string strr = BLLObj.LoadfloorByOfficeIDinEdit(OfficeID);

            dt        = GlobalVaribles.DeserializeDataTable(strr);
            cbo.Value = Convert.ToInt32(dt.Rows[0]["FloorID"].ToString());
            // cbo.ReadOnly = true;
        }
Exemple #17
0
        public void LoadofficeDetailsByID(UltraCombo cbo, int OfficeID)
        {
            string str = BLLObj.LoadofficeDetailsByID(OfficeID);

            dt = GlobalVaribles.DeserializeDataTable(str);
            if (dt != null && dt.Rows.Count > 0)
            {
                txttenantName.Text         = dt.Rows[0]["TenantName"].ToString();
                txtRent.Text               = dt.Rows[0]["OfficeRent"].ToString();
                txtElectricityPerUnit.Text = dt.Rows[0]["ElectricityPerUnit"].ToString();
                txtGeneratorPerUnit.Text   = dt.Rows[0]["GeneratorPerUnit"].ToString();
                txtMaintence.Text          = dt.Rows[0]["Maintenance"].ToString();
                txtwater.Text              = dt.Rows[0]["Water"].ToString();

                //txtOfficeID.Text = dt.Rows[0]["OfficeID"].ToString();

                //cbo.DataSource = dt;
                //cbo.ValueMember = "FloorID";
                //cbo.DisplayMember = "FloorName";
                //cbo.DisplayLayout.Bands[0].Columns["FloorID"].Hidden = true;
                //cbo.DisplayLayout.AutoFitStyle = AutoFitStyle.ResizeAllColumns;
                //cbo.Value = OfficeID;
            }
        }
        void LoadDataGridView()
        {
            DataTable dt = new DataTable();

            DAL.DAL_UserManagement NewDLLObj = new DAL.DAL_UserManagement();
            //dt = NewDLLObj.GetFormName(); BLL_Obj.GetAllFormName();
            string str = BLLObj.GetAllFormName();

            dt = GlobalVaribles.DeserializeDataTable(str);
            if (dt != null && dt.Rows.Count > 0)
            {
                if (i == 0)
                {
                    dataGrdUserManagement.DataSource = dt;

                    DataGridViewCheckBoxColumn CheckBox = new DataGridViewCheckBoxColumn();
                    CheckBox.HeaderText = "Rights";
                    CheckBox.Name       = "CanView";
                    CheckBox.Width      = 5;
                    CheckBox.CellTemplate.Style.BackColor = Color.WhiteSmoke;
                    CheckBox.DefaultCellStyle.ForeColor   = Color.DimGray;
                    dataGrdUserManagement.Columns.Add(CheckBox);

                    dataGrdUserManagement.Columns[0].Visible = false;
                    DataGridViewCellStyle columnHeaderStyle = new DataGridViewCellStyle();
                    columnHeaderStyle.BackColor = Color.Beige;
                    columnHeaderStyle.Font      = new Font("Open Sans", 10, FontStyle.Regular);
                    columnHeaderStyle.ForeColor = Color.Black;
                    dataGrdUserManagement.ColumnHeadersDefaultCellStyle = columnHeaderStyle;
                    //dataGrdUserManagement.AllowUserToAddRows = false;
                    //dataGrdUserManagement.ReadOnly = true;
                    dataGrdUserManagement.Columns[1].ReadOnly = true;

                    dataGrdUserManagement.Columns[1].Width = 148;
                    dataGrdUserManagement.Columns[2].Width = 70;

                    dataGrdUserManagement.RowsDefaultCellStyle.BackColor            = Color.WhiteSmoke;
                    dataGrdUserManagement.AlternatingRowsDefaultCellStyle.BackColor = Color.White;
                    dataGrdUserManagement.ColumnHeadersDefaultCellStyle.BackColor   = Color.LightGray;
                    dataGrdUserManagement.EnableHeadersVisualStyles = false;
                    this.dataGrdUserManagement.GridColor            = Color.DarkGray;
                    dataGrdUserManagement.ForeColor = Color.DimGray;
                    dataGrdUserManagement.EnableHeadersVisualStyles             = false;
                    dataGrdUserManagement.ColumnHeadersHeight                   = 30;
                    dataGrdUserManagement.ColumnHeadersHeightSizeMode           = DataGridViewColumnHeadersHeightSizeMode.DisableResizing;
                    dataGrdUserManagement.ColumnHeadersDefaultCellStyle.Padding = new Padding(0, 0, 0, 0);
                    dataGrdUserManagement.Columns[1].HeaderCell.Style.Padding   = new Padding(08, 0, 0, 0);
                    dataGrdUserManagement.Columns[2].HeaderCell.Style.Padding   = new Padding(08, 0, 0, 0);
                    //dataGrdUserManagement.Columns[2].HeaderCell.Style.Alignment = DataGridViewContentAlignment.MiddleCenter;

                    dataGrdUserManagement.Columns[1].DefaultCellStyle.Padding = new Padding(10, 0, 0, 0);
                    dataGrdUserManagement.Columns[2].DefaultCellStyle.Padding = new Padding(0, 0, 0, 0);
                }
                else
                {
                    dataGrdUserManagement.DataSource = dt;
                    dataGrdUserManagement.Columns.Remove("CanView");
                    DataGridViewCheckBoxColumn CheckBx = new DataGridViewCheckBoxColumn();
                    CheckBx.HeaderText = "Rights";
                    CheckBx.Name       = "CanView";
                    CheckBx.Width      = 5;
                    CheckBx.CellTemplate.Style.BackColor = Color.WhiteSmoke;
                    CheckBx.DefaultCellStyle.ForeColor   = Color.DimGray;
                    dataGrdUserManagement.Columns.Add(CheckBx);

                    dataGrdUserManagement.Columns[0].Visible = false;
                    DataGridViewCellStyle columnHeaderStyle = new DataGridViewCellStyle();
                    columnHeaderStyle.BackColor = Color.Beige;
                    columnHeaderStyle.Font      = new Font("Open Sans", 10, FontStyle.Regular);
                    columnHeaderStyle.ForeColor = Color.Black;
                    dataGrdUserManagement.ColumnHeadersDefaultCellStyle = columnHeaderStyle;
                    //dataGrdUserManagement.AllowUserToAddRows = false;
                    //dataGrdUserManagement.ReadOnly = true;
                    dataGrdUserManagement.Columns[1].ReadOnly = true;

                    dataGrdUserManagement.Columns[1].Width = 148;
                    dataGrdUserManagement.Columns[2].Width = 70;

                    dataGrdUserManagement.RowsDefaultCellStyle.BackColor            = Color.WhiteSmoke;
                    dataGrdUserManagement.AlternatingRowsDefaultCellStyle.BackColor = Color.White;
                    dataGrdUserManagement.ColumnHeadersDefaultCellStyle.BackColor   = Color.LightGray;
                    dataGrdUserManagement.EnableHeadersVisualStyles = false;
                    this.dataGrdUserManagement.GridColor            = Color.DarkGray;
                    dataGrdUserManagement.ForeColor = Color.DimGray;
                    dataGrdUserManagement.EnableHeadersVisualStyles             = false;
                    dataGrdUserManagement.ColumnHeadersHeight                   = 30;
                    dataGrdUserManagement.ColumnHeadersHeightSizeMode           = DataGridViewColumnHeadersHeightSizeMode.DisableResizing;
                    dataGrdUserManagement.ColumnHeadersDefaultCellStyle.Padding = new Padding(0, 0, 0, 0);
                    dataGrdUserManagement.Columns[1].HeaderCell.Style.Padding   = new Padding(08, 0, 0, 0);
                    dataGrdUserManagement.Columns[2].HeaderCell.Style.Padding   = new Padding(08, 0, 0, 0);
                    //dataGrdUserManagement.Columns[2].HeaderCell.Style.Alignment = DataGridViewContentAlignment.MiddleCenter;


                    dataGrdUserManagement.Columns[1].DefaultCellStyle.Padding = new Padding(10, 0, 0, 0);
                    dataGrdUserManagement.Columns[2].DefaultCellStyle.Padding = new Padding(0, 0, 0, 0);
                }
            }
        }
        private void btnEdit_Click(object sender, EventArgs e)
        {
            object rValue;

            try
            {
                string str = BLLObj.LoadAllUsers();

                GlobalVaribles.dtGSearch = GlobalVaribles.DeserializeDataTable(str);

                rValue = FrmGSearch.Show("Select", false, "All Cities");
                if (rValue == null)
                {
                    return;
                }

                //rValue = FrmGSearch.Show("Select UserID,UserName from Users where Status=1", false, "All System Users Records");

                //if (rValue == null)
                //    return;
                if (Convert.ToInt64(rValue.ToString()) == 1)
                {
                    MessageBox.Show("Admin Account Can't Be Edit", GlobalVaribles.ProjectName, MessageBoxButtons.OK, MessageBoxIcon.Stop);
                    return;
                }
                UserID         = Convert.ToInt64(rValue.ToString());
                lblUserID.Text = Convert.ToInt64(UserID).ToString();
                DataTable dt = new DataTable();
                //DAL_UserManagement NewDLLObj = new DAL_UserManagement();
                string strr = BLLObj.GetUserDetail(Convert.ToInt32(UserID));
                dt = GlobalVaribles.DeserializeDataTable(strr);
                if (dt != null && dt.Rows.Count > 0)
                {
                    txtusername.Text   = dt.Rows[0]["UserName"].ToString();
                    txtpassword.Text   = dt.Rows[0]["Password"].ToString();
                    txtretypepass.Text = dt.Rows[0]["Password"].ToString();
                    //    btnDelete.Visible = true;
                    btnUpdate.Enabled = true;
                    btnSave.Enabled   = false;
                    //cboroleid
                }
                DataTable dtUserRights         = new DataTable();
                string    struserRightsDetails = BLLObj.GetUserRightsDetails(Convert.ToInt32(UserID));
                dtUserRights = GlobalVaribles.DeserializeDataTable(struserRightsDetails);
                //dtUserRights = NewDLLObj.GetUserRightsDetails(Convert.ToInt32(UserID));
                if (dtUserRights != null && dtUserRights.Rows.Count > 0)
                {
                    int DataGridRow = 0;
                    foreach (DataRow dr in dtUserRights.Rows)
                    {
                        dataGrdUserManagement.Rows[DataGridRow].Cells["FormID"].Value  = dr["FormID"];
                        dataGrdUserManagement.Rows[DataGridRow].Cells[2].Value         = dr["DisplayName"];
                        dataGrdUserManagement.Rows[DataGridRow].Cells["CanView"].Value = dr["CanView"];
                        DataGridRow++;
                    }
                }
                else
                {
                    LoadDataGridView();
                }
            }
            catch (Exception ex)
            {
                //throw ex;
            }
        }
Exemple #20
0
        public void LoadAllCities()
        {
            string str = BLLObj.LoadAllCity();

            dt = GlobalVaribles.DeserializeDataTable(str);
        }