private void btnClientID_Click(object sender, EventArgs e)
        {
            object rValue;

            try
            {
                rValue = FrmGSearch.Show("Select ClientID,ClientCode as MemberCode,ClientName As MemberName,NIC,Address From Trans_Clients", false, "All Clients");
                if (rValue == null)
                {
                    return;
                }
                ClientID = long.Parse(rValue.ToString());

                DataTable dt = new DataTable();
                BP_RptClientIssuencecDateWise NewBPObj = new BP_RptClientIssuencecDateWise();
                dt = NewBPObj.GetClientName(int.Parse(ClientID.ToString()));
                if (dt.Rows.Count > 0)
                {
                    txtMemberName.Text = dt.Rows[0]["ClientName"].ToString();
                }
                dt.Dispose();
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message, "Easy Rashan Management System", MessageBoxButtons.OK, MessageBoxIcon.Stop);
            }
        }
        private void btnEmp_Click(object sender, EventArgs e)
        {
            object rValue;

            try
            {
                rValue = FrmGSearch.Show("Select EmpName From Emp_Def", false, "All Employees");
                if (rValue == null)
                {
                    return;
                }
                EmpID = long.Parse(rValue.ToString());
                DataTable dt = new DataTable();
                BP_RptClientIssuencecDateWise NewBP = new BP_RptClientIssuencecDateWise();
                dt = NewBP.GetEmpName(int.Parse(EmpID.ToString()));
                if (dt.Rows.Count > 0)
                {
                    txtEmpName.Text = dt.Rows[0]["EmpName"].ToString();
                }
            }

            catch (Exception ex)
            {
                MessageBox.Show(ex.Message, "Easy Rashan Management System", MessageBoxButtons.OK, MessageBoxIcon.Stop);
            }
        }
Esempio n. 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);
            }
        }
Esempio n. 4
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);
            }
        }
        private void btnVendor_Click(object sender, EventArgs e)
        {
            object rValue;

            rValue = FrmGSearch.Show("Select PrID,Convert(varchar(12),PrDate,106) AS [PrDate],VendorName From Trans_PurchaseM Where IsActive=1", false, "All Purchase Items");
            if (rValue == null)
            {
                return;
            }
            PrID = long.Parse(rValue.ToString());
            DataTable      dt    = new DataTable();
            Bp_RptPurchase NewBP = new Bp_RptPurchase();

            dt = NewBP.GetVendorName(int.Parse(PrID.ToString()));
            if (dt.Rows.Count > 0)
            {
                txtVendorName.Text = dt.Rows[0]["VendorName"].ToString();
            }
            dt.Dispose();
        }
Esempio n. 6
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);
            }
        }
Esempio n. 7
0
        private void btnUntiID_Click(object sender, EventArgs e)
        {
            object rValue;

            try
            {
                rValue = FrmGSearch.Show("Select MUnitID,MUnitName From MUnit", false, "All Measuring Units");
                if (rValue == null)
                {
                    return;
                }
                MUnitID = long.Parse(rValue.ToString());
                DataTable     dt      = new DataTable();
                SqlConnection sqlconn = new SqlConnection(ConnString);
                sqlconn.Open();
                SqlCommand sqlcomm = new SqlCommand("GetMUnitName", sqlconn);
                sqlcomm.CommandType = CommandType.StoredProcedure;
                sqlcomm.Parameters.AddWithValue("@MUnitID", MUnitID);
                dt = GetDataTable(sqlcomm, sqlconn);
                if (dt.Rows.Count > 0)
                {
                    UpdateRecord             = true;
                    GetRecord                = true;
                    txtMUnitID.Text          = dt.Rows[0]["MUnitID"].ToString();
                    txtMUnitName.Text        = dt.Rows[0]["MUnitName"].ToString();
                    chkIsActive.CheckedValue = bool.Parse(dt.Rows[0]["IsActive"].ToString());
                    btnEdit.Enabled          = true;
                    btnOK.Enabled            = false;
                }
                dt.Dispose();
                sqlcomm.Dispose();
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message, GlobalVaribles.ProjectName, MessageBoxButtons.OK, MessageBoxIcon.Stop);
            }
        }
        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;
            }
        }