private void gv_search_DoubleClick(object sender, EventArgs e)
        {
            DataRow dr = gv_search.GetFocusedDataRow();

            if (dr == null)
            {
                XtraMessageBox.Show("No data has selected.");
                return;
            }
            //string account_no = dr["AccountNo"].ToString();
            //string account_name = dr["AccHolderName"].ToString();

            AccountHolderInfo objProductInfo = new AccountHolderInfo();

            objProductInfo.AccHolderInfoId = Convert.ToInt64(dr["AccHolderInfoId"].ToString());
            objProductInfo.AccountNo       = dr["AccountNo"].ToString();
            objProductInfo.AccHolderName   = dr["AccHolderName"].ToString();
            objProductInfo.RSMID           = dr["RSMID"].ToString();
            if (dr["ZoneID"].ToString() != "")
            {
                objProductInfo.ZoneID = Convert.ToInt64(dr["ZoneID"].ToString());
            }

            bllUtility.ReturnSearchedAccountHolderInfo.returnSearchedAccountHolderInfo = objProductInfo;

            this.Close();
        }
        public static bool Update(AccountHolderInfo objAccountHolderInfo)
        {
            ISalesPOSDBManager dbManager = new SalesPOSDBManager();
            Boolean            chk       = false;

            try
            {
                dbManager.Open();
                IDbDataParameter[] param = SalesPOSDBManagerFactory.GetParameters(dbManager.ProviderType, 9);

                param[0] = dbManager.getparam("@AccHolderInfoId", objAccountHolderInfo.AccHolderInfoId.ToString());
                param[1] = dbManager.getparam("@AccHolderName", objAccountHolderInfo.AccHolderName.ToString());
                param[2] = dbManager.getparam("@Address", objAccountHolderInfo.Address.ToString());
                param[3] = dbManager.getparam("@ContactNo", objAccountHolderInfo.ContactNo.ToString());
                param[4] = dbManager.getparam("@ActivityID", objAccountHolderInfo.ActivityID.ToString());
                param[5] = dbManager.getparam("@UpdatedDate", objAccountHolderInfo.UpdatedDate);
                param[6] = dbManager.getparam("@UpdatedBy", objAccountHolderInfo.UpdatedBy.ToString());
                param[7] = dbManager.getparam("@ZoneID", objAccountHolderInfo.ZoneID);
                param[8] = dbManager.getparam("@RSMID", objAccountHolderInfo.RSMID);
                IDbCommand cmd = dbManager.getCommand(CommandType.StoredProcedure, "USP_AccountHolderInfo_Update", param);

                chk = dbManager.ExecuteQuery(cmd);
            }
            catch (Exception ex)
            {
                return(false);

                MessageBox.Show(ex.ToString());
            }
            finally
            {
                dbManager.Dispose();
            }
            return(chk);
        }
        private void frmCustomerSearch_FormClosing(object sender, FormClosingEventArgs e)
        {
            if (bllUtility.ReturnSearchedAccountHolderInfo.returnSearchedAccountHolderInfo == null)
            {
                AccountHolderInfo objAccountHolderInfo = new AccountHolderInfo();
                objAccountHolderInfo.AccHolderInfoId = 0;
                objAccountHolderInfo.AccountNo       = "";
                objAccountHolderInfo.AccHolderName   = "";

                bllUtility.ReturnSearchedAccountHolderInfo.returnSearchedAccountHolderInfo = objAccountHolderInfo;
            }
        }
        private void dgvCustomerInfoList_CellMouseDoubleClick(object sender, DataGridViewCellMouseEventArgs e)
        {
            DataGridView dgv = (DataGridView)sender;

            AccountHolderInfo objProductInfo = new AccountHolderInfo();

            objProductInfo.AccHolderInfoId = Convert.ToInt64(dgv.Rows[e.RowIndex].Cells[0].Value.ToString());
            objProductInfo.AccountNo       = dgv.Rows[e.RowIndex].Cells[1].Value.ToString();
            objProductInfo.AccHolderName   = dgv.Rows[e.RowIndex].Cells[2].Value.ToString();

            bllUtility.ReturnSearchedAccountHolderInfo.returnSearchedAccountHolderInfo = objProductInfo;

            this.Close();
        }
Example #5
0
        private void btnSave_Click(object sender, EventArgs e)
        {
            this.err_accountholderinfo.Clear();
            if (isValid())
            {
                if (!this._isNew)
                {
                    if (_SelctedAccHolderInfoId > 0)
                    {
                        //update here
                        bool chk = true;

                        AccountHolderInfo objAccountHolderInfo = new AccountHolderInfo();
                        objAccountHolderInfo.AccHolderInfoId = this._SelctedAccHolderInfoId;
                        objAccountHolderInfo.AccHolderName   = this.txtAccountHolderName.Text.Trim();
                        objAccountHolderInfo.ContactNo       = this.txtContactNum.Text.Trim();
                        objAccountHolderInfo.Address         = this.txtAddress.Text;
                        objAccountHolderInfo.ActivityID      = Convert.ToInt64(this.cmbActivity.SelectedValue);

                        objAccountHolderInfo.UpdatedBy    = bllUtility.LoggedInSystemInformation.LoggedUserId;
                        objAccountHolderInfo.UpdatedDate  = DateTime.Now;
                        objAccountHolderInfo.CustomerType = cmb_customer_type.Text;

                        chk = bllAccountHolderInfo.Update(objAccountHolderInfo);
                        if (chk)
                        {
                            LoadGrid();
                            //show success message here
                            MessageBox.Show("Successfully Updated the record", "Information", MessageBoxButtons.OK, MessageBoxIcon.Information);
                            ClearFields();
                            this._isNew = true;
                        }
                    }
                    else
                    {
                        MessageBox.Show("No data found for update.", "Information", MessageBoxButtons.OK, MessageBoxIcon.Information);
                    }
                }
                else
                {
                    //this._GridRowSelectedIndex = this.dgvUnitList.Rows.Count;
                    bool chk = true;
                    //insert validation method

                    //insert here
                    AccountHolderInfo objAccountHolderInfo = new AccountHolderInfo();
                    //objAccountHolderInfo.AccHolderInfoId = this._SelctedAccHolderInfoId;
                    objAccountHolderInfo.AccHolderName       = this.txtAccountHolderName.Text.Trim();
                    objAccountHolderInfo.AccountHolderTypeID = Convert.ToInt64(this.cmbType.SelectedValue);
                    objAccountHolderInfo.AccountNo           = this.txtAccountNumber.Text;
                    objAccountHolderInfo.ActivityID          = Convert.ToInt64(this.cmbActivity.SelectedValue);
                    objAccountHolderInfo.Address             = this.txtAddress.Text;
                    objAccountHolderInfo.ContactNo           = this.txtContactNum.Text;
                    objAccountHolderInfo.CreatedBy           = bllUtility.LoggedInSystemInformation.LoggedUserId;
                    objAccountHolderInfo.CreatedDate         = DateTime.Now;
                    objAccountHolderInfo.CustomerType        = cmb_customer_type.Text;


                    chk = bllAccountHolderInfo.Insert(objAccountHolderInfo);
                    if (chk)
                    {
                        LoadGrid();
                        //show success message here
                        //string s = "AccountHolderTypeID = " + this.cmbType.SelectedValue.ToString();

                        //DataRow drAccountHolderType = dtAccountHolderType.NewRow();

                        //drAccountHolderType = dtAccountHolderType.Select(s).FirstOrDefault();
                        //drAccountHolderType[8] = objAccountHolderInfo.AccountNo.ToString().Substring(3).ToString();
                        ClearFields();
                        this._isNew = true;
                    }
                }

                this._SelctedAccHolderInfoId = 0;
            }
        }
Example #6
0
        private void btnSave_Click(object sender, EventArgs e)
        {
            this.err_accountholderinfo.Clear();
            if (this.cmb_type.EditValue == null)
            {
                XtraMessageBox.Show("Account holder type selection required!");
                cmb_type.Focus();
                return;
            }
            if (this.cmb_zone.EditValue == null)
            {
                XtraMessageBox.Show("Zone selection required!");
                cmb_zone.Focus();
                return;
            }
            if (isValid())
            {
                string rsmid = "";
                if (cmb_rsm.EditValue == null || cmb_rsm.EditValue.ToString() == "")
                {
                    rsmid = "";
                }
                else
                {
                    rsmid = cmb_rsm.EditValue.ToString();
                }

                if (!this._isNew)
                {
                    if (_SelctedAccHolderInfoId > 0)
                    {
                        //update here
                        bool chk = true;

                        AccountHolderInfo objAccountHolderInfo = new AccountHolderInfo();
                        objAccountHolderInfo.AccHolderInfoId = this._SelctedAccHolderInfoId;
                        objAccountHolderInfo.AccHolderName   = this.txtAccountHolderName.Text.Trim();
                        objAccountHolderInfo.ContactNo       = this.txtContactNum.Text.Trim();
                        objAccountHolderInfo.Address         = this.txtAddress.Text;
                        objAccountHolderInfo.ActivityID      = Convert.ToInt64(this.cmbActivity.SelectedValue);
                        objAccountHolderInfo.ZoneID          = Convert.ToInt64(this.cmb_zone.EditValue.ToString());
                        objAccountHolderInfo.UpdatedBy       = bllUtility.LoggedInSystemInformation.LoggedUserId;
                        objAccountHolderInfo.UpdatedDate     = DateTime.Now;
                        objAccountHolderInfo.RSMID           = rsmid;
                        chk = bllAccountHolderInfo.Update(objAccountHolderInfo);
                        if (chk)
                        {
                            LoadGrid();
                            //show success message here
                            //XtraMessageBox.Show("Successfully Updated the record", "Information", MessageBoxButtons.OK, MessageBoxIcon.Information);
                            XtraMessageBox.Show("Successfully Updated the record");
                            ClearFields();
                            this._isNew = true;
                        }
                    }
                    else
                    {
                        XtraMessageBox.Show("No data found for update.", "Information", MessageBoxButtons.OK, MessageBoxIcon.Information);
                    }
                }
                else
                {
                    //this._GridRowSelectedIndex = this.dgvUnitList.Rows.Count;
                    bool chk = true;
                    //insert validation method

                    //insert here
                    AccountHolderInfo objAccountHolderInfo = new AccountHolderInfo();
                    //objAccountHolderInfo.AccHolderInfoId = this._SelctedAccHolderInfoId;
                    objAccountHolderInfo.AccHolderName       = this.txtAccountHolderName.Text.Trim();
                    objAccountHolderInfo.AccountHolderTypeID = Convert.ToInt64(this.cmb_type.EditValue.ToString());
                    objAccountHolderInfo.AccountNo           = this.txtAccountNumber.Text;
                    objAccountHolderInfo.ActivityID          = Convert.ToInt64(this.cmbActivity.SelectedValue);
                    objAccountHolderInfo.ZoneID      = Convert.ToInt64(this.cmb_zone.EditValue.ToString());
                    objAccountHolderInfo.Address     = this.txtAddress.Text;
                    objAccountHolderInfo.ContactNo   = this.txtContactNum.Text;
                    objAccountHolderInfo.CreatedBy   = bllUtility.LoggedInSystemInformation.LoggedUserId;
                    objAccountHolderInfo.CreatedDate = DateTime.Now;
                    objAccountHolderInfo.RSMID       = rsmid;


                    chk = bllAccountHolderInfo.Insert(objAccountHolderInfo);
                    if (chk)
                    {
                        LoadGrid();
                        ClearFields();
                        this._isNew = true;
                    }
                }
                this._SelctedAccHolderInfoId = 0;
            }
        }