public byte[] GetCustomerImagePhoto(string Id, string boid) { byte[] image = null; DataTable dt = new DataTable(); CustomerInfoBAL bal = new CustomerInfoBAL(); string Cust_Code = Id != string.Empty ? Convert.ToString(bal.GetCustomerCode(boid).Rows[0][0]) : Id; string query = ""; string queryImage = ""; if (Id != "") { query = @" select [Photo] FROM [SBP_Cust_Image] where [Cust_Code]='" + Id + "'"; queryImage = @" select [Photo] FROM [SBP_Cust_Image_ImgExt] where [Cust_Code]='" + Id + "'"; } else { query = @"select [Photo] FROM [SBP_Cust_Image] where [Cust_Code]=(select [Cust_Code] from [SBP_Customers] where [BO_ID]='" + boid + "')"; queryImage = @"select [Photo] FROM [SBP_Cust_Image_ImgExt] where [Cust_Code]='" + Cust_Code + @"'"; } try { _dbconneciton.ConnectDatabase_ImageExt(); dt = _dbconneciton.ExecuteQuery_ImageExt(queryImage); } catch (Exception ex) { try { _dbconneciton.ConnectDatabase(); dt = _dbconneciton.ExecuteQuery(query); } catch (Exception ext) { throw new Exception(ex.Message); } finally { _dbconneciton.CloseDatabase(); } } finally { _dbconneciton.CloseDatabase_ImageExt(); } if (dt.Rows.Count > 0) { if (dt.Rows[0][0] != DBNull.Value) { image = (byte[])dt.Rows[0][0]; } } return(image); }
public byte[] jointholderSignature(string id) { byte[] image = null; DataTable dt = new DataTable(); CustomerInfoBAL bal = new CustomerInfoBAL(); string Cust_Code = id.Length > 7 ? Convert.ToString(bal.GetCustomerCode(id).Rows[0][0]) : id; string queryImage = ""; string query = ""; if (id.Length > 7) { query = @"select [Signature] from [SBP_Joint_holder_Image] where cust_code=(select [Cust_Code] from [SBP_Customers] where [BO_ID]='" + id + "')"; queryImage = @" select [Signature] FROM [SBP_Joint_holder_Image_ImgExt] where [Cust_Code]='" + Cust_Code + "'"; } else { query = @"select [Signature] from [SBP_Joint_holder_Image] where cust_code='" + Cust_Code + "'"; queryImage = @" select [Signature] FROM [SBP_Joint_holder_Image_ImgExt] where [Cust_Code]='" + Cust_Code + "'"; } try { _dbconneciton.ConnectDatabase_ImageExt(); dt = _dbconneciton.ExecuteQuery_ImageExt(queryImage); } catch (Exception ex) { try { _dbconneciton.ConnectDatabase(); dt = _dbconneciton.ExecuteQuery(query); } catch (Exception ext) { throw new Exception(ex.Message); } finally { _dbconneciton.CloseDatabase(); } } finally { _dbconneciton.CloseDatabase_ImageExt(); } if (dt.Rows.Count > 0) { if (dt.Rows[0][0] != DBNull.Value) { image = (byte[])dt.Rows[0][0]; } } return(image); }
private void LoadCustInfo() { DataTable custDateTable = new DataTable(); CustomerInfoBAL customerInfoBAL = new CustomerInfoBAL(); if (ddlSearchCustomer.SelectedItem.Equals("BO Id")) { _boID = txtSearchCustomer.Text; custDateTable = customerInfoBAL.GetCustInfoByBOID(_boID); if (custDateTable.Rows.Count > 0) { int _custCode = Convert.ToInt32(custDateTable.Rows[0][0].ToString()); txtCustCode.Text = custDateTable.Rows[0][0].ToString(); txtAccountHolderName.Text = custDateTable.Rows[0][1].ToString(); txtAccountHolderBOId.Text = custDateTable.Rows[0][2].ToString(); } else { MessageBox.Show("No customer found."); } } else { _custCode = txtSearchCustomer.Text; custDateTable = customerInfoBAL.GetCustInfoByCustCode(_custCode); if (custDateTable.Rows.Count > 0) { txtCustCode.Text = custDateTable.Rows[0][0].ToString(); txtAccountHolderName.Text = custDateTable.Rows[0][1].ToString(); txtAccountHolderBOId.Text = custDateTable.Rows[0][2].ToString(); } else { MessageBox.Show("No customer found."); } } }
private void LoadCustInfo() { DataTable custDateTable = new DataTable(); DataTable NewcustDateTable = new DataTable(); CustomerInfoBAL customerInfoBAL = new CustomerInfoBAL(); string newCust = string.Empty; if (tempMenuPurpose != newCustomerMoneyBalance) { if (ddlSearchCustomer.SelectedItem.Equals("BO Id")) { _boID = txtSearchCustomer.Text; custDateTable = customerInfoBAL.GetCustInfoByBOID(_boID); if (custDateTable.Rows.Count > 0) { int _custCode = Convert.ToInt32(custDateTable.Rows[0][0].ToString()); txtCustCode.Text = custDateTable.Rows[0][0].ToString(); txtAccountHolderName.Text = custDateTable.Rows[0][1].ToString(); txtAccountHolderBOId.Text = custDateTable.Rows[0][2].ToString(); } else { MessageBox.Show("No customer found."); } } else { _custCode = txtSearchCustomer.Text; custDateTable = customerInfoBAL.GetCustInfoByCustCode(_custCode); if (custDateTable.Rows.Count > 0) { txtCustCode.Text = custDateTable.Rows[0][0].ToString(); txtAccountHolderName.Text = custDateTable.Rows[0][1].ToString(); txtAccountHolderBOId.Text = custDateTable.Rows[0][2].ToString(); } else { MessageBox.Show("No customer found."); } } } else { NewcustDateTable = customerInfoBAL.IsExistNewCustomerCode(txtSearchCustomer.Text); if (NewcustDateTable.Rows.Count > 0) { if (NewcustDateTable.Rows[0][1].ToString() != "") //Check BO_ID { MessageBox.Show("The Customer Already exist, The report Can't Shown here", "Existing Customer Check", MessageBoxButtons.OK, MessageBoxIcon.Information); return; } else if (NewcustDateTable.Rows[0][0].ToString() != "") { newCust = NewcustDateTable.Rows[0][0].ToString(); txtCustCode.Text = newCust; } } else { MessageBox.Show("Customer not exist", "Customer Check", MessageBoxButtons.OK, MessageBoxIcon.Information); return; } } }