Beispiel #1
0
        private void txt_RFID_TextChanged(object sender, EventArgs e)
        {
            if (txt_RFID.Text.Length < 10) return;
            {
                BALCust_Registration SearchForTopUp = new BALCust_Registration();
                SearchForTopUp.CRUD = "SearchForTopUp";
                SearchForTopUp.RFID = Convert.ToInt64(txt_RFID.Text);
                RFID = Convert.ToInt64(txt_RFID.Text);
                DataTable dt = new DataTable();
                dt = SearchForTopUp.Cust_Registration(SearchForTopUp);
                if (dt != null && dt.Rows.Count > 0)
                {
                    txt_RFID.Text = null;
                    lbl_Name.Text = dt.Rows[0]["Name"].ToString();
                    lbl_CarNo.Text = dt.Rows[0]["CarNo"].ToString();
                    lbl_CurrentAmount.Text = dt.Rows[0]["CurrentBalance"].ToString();
                    UpdateAmount = Convert.ToInt32(dt.Rows[0]["CurrentBalance"].ToString());
                    lbl_Name.Visible = lbl_CarNo.Visible =lbl_CurrentAmount.Visible=true;
                   

                }
            }
            //if (txt_RegNo.Text.Length == 9)
            //{
            //    BALCust_Registration SearchCustomer = new BALCust_Registration();
            //    SearchCustomer.CRUD = "Search";
            //    DataTable dt = new DataTable();
            //    dt = SearchCustomer.Cust_Registration(SearchCustomer);
            //    if (dt != null && dt.Rows.Count > 0)
            //    {
            //        txt_Name.Text = dt.Rows[0]["Name"].ToString();
            //        txt_FatherName.Text = dt.Rows[0]["FName"].ToString();
            //        txt_NICNo.Text = dt.Rows[0]["NicNo"].ToString();
            //        txt_CarNo.Text = dt.Rows[0]["CarNo"].ToString();
            //        cbo_CarName.Text = dt.Rows[0]["CarName"].ToString();
            //        cbo_CarManufacturer.Text = dt.Rows[0]["CarManufacturer"].ToString();
            //        txt_EngineNo.Text = dt.Rows[0]["EngineNo"].ToString();
            //        txt_ChasisNo.Text = dt.Rows[0]["ChasisNo"].ToString();
            //        txt_LicenseNo.Text = dt.Rows[0]["LicenseNo"].ToString();

            //        txt_Name.ReadOnly = true;
            //        txt_FatherName.ReadOnly = true;
            //        txt_NICNo.ReadOnly = true;
            //        txt_NICNo.ReadOnly = true;
            //        txt_CarNo.ReadOnly = true;
            //        txt_EngineNo.ReadOnly = true;
            //        txt_ChasisNo.ReadOnly = true;
            //        txt_LicenseNo.ReadOnly = true;

        }
Beispiel #2
0
        private void tb_RFID_TextChanged(object sender, EventArgs e)
        {
            if (tb_RFID.Text.Length < 8) return;
            BALCust_Registration objCustomer = new BALCust_Registration();
            objCustomer.CRUD = "Search";
            objCustomer.RFID = Convert.ToInt64(tb_RFID.Text);
            DataTable dt = new DataTable();
            dt = objCustomer.Cust_Registration(objCustomer);
            lbl_CurrAmount.Text = dt.Rows[0]["CurrentBalance"].ToString();
            if (dt != null && dt.Rows.Count > 0)
            {
                lbl_PrvsAmount.Text = dt.Rows[0]["CurrentBalance"].ToString();
                BALCust_Registration oBALCust_Registration = new BALCust_Registration();
                oBALCust_Registration.CRUD = "Update";
                oBALCust_Registration.RFID = Convert.ToInt64(tb_RFID.Text);
                oBALCust_Registration.CurrentBalance = Convert.ToInt32(dt.Rows[0]["CurrentBalance"]) - 20;
                lbl_CurrAmount.Text = Convert.ToString(Convert.ToInt32(dt.Rows[0]["CurrentBalance"]) - 20);
                DataTable dtUpdate = new DataTable();
                oBALCust_Registration.Cust_Registration(oBALCust_Registration);


                BALtblTransaction oBALtblTransaction = new BALtblTransaction();
                oBALtblTransaction.CRUD = "Insert";
                oBALtblTransaction.RefID = Convert.ToInt64(tb_RFID.Text);
                DataTable dtInsert = new DataTable();
                dtInsert = oBALtblTransaction.tblTransaction(oBALtblTransaction);
                if (dtInsert != null && dtInsert.Rows.Count > 0)
                {
                    MessageBox.Show("Verified");
                    tb_RFID.Text = "";
                }




               
            }

        }
Beispiel #3
0
        private void txt_RegNo_TextChanged(object sender, EventArgs e)
        {
            if (txt_RegNo.Text.Length == 9)
            {
                BALCust_Registration SearchCustomer = new BALCust_Registration();
                SearchCustomer.CRUD = "Search";
                DataTable dt = new DataTable();
                dt = SearchCustomer.Cust_Registration(SearchCustomer);
                if (dt != null && dt.Rows.Count > 0)
                {
                    txt_Name.Text = dt.Rows[0]["Name"].ToString();
                    txt_FatherName.Text = dt.Rows[0]["FName"].ToString();
                    txt_NICNo.Text = dt.Rows[0]["NicNo"].ToString();
                    txt_CarNo.Text = dt.Rows[0]["CarNo"].ToString();
                    cbo_CarName.Text = dt.Rows[0]["CarName"].ToString();
                    cbo_CarManufacturer.Text = dt.Rows[0]["CarManufacturer"].ToString();
                    txt_EngineNo.Text = dt.Rows[0]["EngineNo"].ToString();
                    txt_ChasisNo.Text = dt.Rows[0]["ChasisNo"].ToString();
                    txt_LicenseNo.Text = dt.Rows[0]["LicenseNo"].ToString();

                    txt_Name.ReadOnly = true;
                    txt_FatherName.ReadOnly = true;
                    txt_NICNo.ReadOnly = true;
                    txt_NICNo.ReadOnly = true;
                    txt_CarNo.ReadOnly = true;
                    txt_EngineNo.ReadOnly = true;
                    txt_ChasisNo.ReadOnly = true;
                    txt_LicenseNo.ReadOnly = true;

                }

            }

            if (txt_RegNo.Text == null && txt_RFID1.Text.Length > 0)
            {
                
            }
        }
Beispiel #4
0
        private void btn_Register_Click(object sender, EventArgs e)
        {
            try
            {
                BALCust_Registration NewCustomer = new BALCust_Registration();
                NewCustomer.CRUD = "Insert";
                NewCustomer.RFID = Convert.ToInt32(txt_RFID1.Text.Trim());
                NewCustomer.Name=txt_Name.Text.Trim();
                NewCustomer.FName = txt_FatherName.Text.Trim();
                NewCustomer.NicNo = Convert.ToInt32(txt_NICNo.Text.Trim());
                NewCustomer.CarNo = txt_CarNo.Text.Trim();
                NewCustomer.CarName = cbo_CarName.SelectedText;
                NewCustomer.CarManufacturer = txt_FatherName.Text.Trim();
                NewCustomer.EngineNo = txt_EngineNo.Text.Trim();
                NewCustomer.ChasisNo = txt_ChasisNo.Text.Trim();
                NewCustomer.LicenseNo = txt_LicenseNo.Text.Trim();

                DataTable dtInsert = new DataTable();
                dtInsert = NewCustomer.Cust_Registration(NewCustomer);
                    ////txt_Name.Text = Convert.ToInt32(["RFID"]);
                    //txt_FatherName.Text = dt.Rows[0]["FName"].ToString();
                    //txt_NICNo.Text = dt.Rows[0]["NicNo"].ToString();
                    //txt_CarNo.Text = dt.Rows[0]["CarNo"].ToString();
                    //cbo_CarName.Text = dt.Rows[0]["CarName"].ToString();
                    //cbo_CarManufacturer.Text = dt.Rows[0]["CarManufacturer"].ToString();
                    //txt_EngineNo.Text = dt.Rows[0]["EngineNo"].ToString();
                    //txt_ChasisNo.Text = dt.Rows[0]["ChasisNo"].ToString();
                    //txt_LicenseNo.Text = dt.Rows[0]["LicenseNo"].ToString();

                    //oBALInvSaleInvoiceDetail.ItemKey = Convert.ToInt32(dr["pk_intItemRecId"]);
                    //oBALInvSaleInvoiceDetail.Quantity = Convert.ToInt32(dr["intQty"]);
                    //oBALInvSaleInvoiceDetail.UnitPrice = Convert.ToDecimal(dr["decUnitPrice"]);
                    //oBALInvSaleInvoiceDetail.TotalPrice = Convert.ToDecimal(dr["decItemPrice"]);
                    //oBALInvSaleInvoiceDetail.InsertedBy = Convert.ToInt32(Session["UserRecId"].ToString());


            }
            catch (Exception eX)
            {
                MessageBox.Show(eX.Message);

            }
        }
Beispiel #5
0
 public DataTable Cust_Registration(BALCust_Registration objBALCust_Registration)
 {
     DataTable dt = new DataTable();
     try
     {
         dt = objDALCust_Registration.Cust_Registration(objBALCust_Registration);
     }
     catch (Exception ex)
     { }
     return dt;
 }
Beispiel #6
0
 private void btn_TopUp_Click(object sender, EventArgs e)
 {
     BALCust_Registration UpdateBalance = new BALCust_Registration();
     UpdateBalance.CRUD = "UpdateBalance";
     UpdateBalance.RFID = RFID;
     UpdateBalance.CurrentBalance=Convert.ToInt32(UpdateAmount+ Convert.ToInt32(txt_TopUp.Text));
     DataTable dtInsert = new DataTable();
     dtInsert = UpdateBalance.Cust_Registration(UpdateBalance);
     if (dtInsert != null && dtInsert.Rows.Count > 0)
     {
         MessageBox.Show("Balance Updated");
         
     }
 }
Beispiel #7
0
        private void btn_Register_Click(object sender, EventArgs e)
        {
            try
            {
                BALCust_Registration NewCustomer = new BALCust_Registration();
                NewCustomer.CRUD = "Insert";
                NewCustomer.RFID = Convert.ToInt32(txt_RFID1.Text.Trim());
                NewCustomer.Name=txt_Name.Text.Trim();
                NewCustomer.FName = txt_FatherName.Text.Trim();
                NewCustomer.NicNo = Convert.ToInt32(txt_NICNo.Text.Trim());
                NewCustomer.CarNo = txt_CarNo.Text.Trim();
                NewCustomer.CarName = cbo_CarName.SelectedText;
                NewCustomer.CarManufacturer = txt_FatherName.Text.Trim();
                NewCustomer.EngineNo = txt_EngineNo.Text.Trim();
                NewCustomer.ChasisNo = txt_ChasisNo.Text.Trim();
                NewCustomer.LicenseNo = txt_LicenseNo.Text.Trim();

                DataTable dtInsert = new DataTable();
                dtInsert = NewCustomer.Cust_Registration(NewCustomer);
                this.Hide();
                MessageBox.Show("Successfully Registered");
                form_AdminSession AdminHome = new form_AdminSession();
                AdminHome.ShowDialog();
                this.Close();

                
                
                    ////txt_Name.Text = Convert.ToInt32(["RFID"]);
                    //txt_FatherName.Text = dt.Rows[0]["FName"].ToString();
                    //txt_NICNo.Text = dt.Rows[0]["NicNo"].ToString();
                    //txt_CarNo.Text = dt.Rows[0]["CarNo"].ToString();
                    //cbo_CarName.Text = dt.Rows[0]["CarName"].ToString();
                    //cbo_CarManufacturer.Text = dt.Rows[0]["CarManufacturer"].ToString();
                    //txt_EngineNo.Text = dt.Rows[0]["EngineNo"].ToString();
                    //txt_ChasisNo.Text = dt.Rows[0]["ChasisNo"].ToString();
                    //txt_LicenseNo.Text = dt.Rows[0]["LicenseNo"].ToString();



            }
            catch (Exception eX)
            {
                MessageBox.Show(eX.Message);

            }
        }
Beispiel #8
0
        public DataTable Cust_Registration(BALCust_Registration objBALCust_Registration)
        {
            DataTable dt = new DataTable();
            //TYPE YOUR STORE PROCEDURE NAME HERE
            string spName = "spro_Cust_Registration";
            SqlParameter[] objSqlParameter = new SqlParameter[14];
            string where = "";
            try
            {
                #region Search

                if (objBALCust_Registration.WHERE != "")
                {
                    where += where == "" ? " WHERE " : " AND ";
                    where += objBALCust_Registration.WHERE;
                }
                if (objBALCust_Registration.RegistrationNo != 0)
                {
                    where += where == "" ? " WHERE " : " AND ";
                    where += "RegistrationNo=" + objBALCust_Registration.RegistrationNo;
                }
                if (objBALCust_Registration.CurrentBalance != 0)
                {
                    where += where == "" ? " WHERE " : " AND ";
                    where += "CurrentBalance=" + objBALCust_Registration.CurrentBalance;
                }
                if (objBALCust_Registration.RFID != 0)
                {
                    where += where == "" ? " WHERE " : " AND ";
                    where += "RFID=" + objBALCust_Registration.RFID;
                }
                if (objBALCust_Registration.NicNo != 0)
                {
                    where += where == "" ? " WHERE " : " AND ";
                    where += "NicNo=" + objBALCust_Registration.NicNo;
                }
                if (objBALCust_Registration.Name != "")
                {
                    where += where == "" ? " WHERE " : " AND ";
                    where += "Name='" + objBALCust_Registration.Name + "'";
                }
                if (objBALCust_Registration.FName != "")
                {
                    where += where == "" ? " WHERE " : " AND ";
                    where += "FName='" + objBALCust_Registration.FName + "'";
                }
                if (objBALCust_Registration.CarNo != "")
                {
                    where += where == "" ? " WHERE " : " AND ";
                    where += "CarNo='" + objBALCust_Registration.CarNo + "'";
                }
                if (objBALCust_Registration.CarName != "")
                {
                    where += where == "" ? " WHERE " : " AND ";
                    where += "CarName='" + objBALCust_Registration.CarName + "'";
                }
                if (objBALCust_Registration.CarManufacturer != "")
                {
                    where += where == "" ? " WHERE " : " AND ";
                    where += "CarManufacturer='" + objBALCust_Registration.CarManufacturer + "'";
                }
                if (objBALCust_Registration.EngineNo != "")
                {
                    where += where == "" ? " WHERE " : " AND ";
                    where += "EngineNo='" + objBALCust_Registration.EngineNo + "'";
                }
                if (objBALCust_Registration.ChasisNo != "")
                {
                    where += where == "" ? " WHERE " : " AND ";
                    where += "ChasisNo='" + objBALCust_Registration.ChasisNo + "'";
                }
                if (objBALCust_Registration.LicenseNo != "")
                {
                    where += where == "" ? " WHERE " : " AND ";
                    where += "LicenseNo='" + objBALCust_Registration.LicenseNo + "'";
                }
                objBALCust_Registration.WHERE = where;
                #endregion

                #region Add

                objSqlParameter[0] = new SqlParameter("@CRUD", objBALCust_Registration.CRUD);
                objSqlParameter[1] = new SqlParameter("@WHERE", objBALCust_Registration.WHERE);

                objSqlParameter[2] = new SqlParameter("@RegistrationNo", objBALCust_Registration.RegistrationNo);

                objSqlParameter[3] = new SqlParameter("@CurrentBalance", objBALCust_Registration.CurrentBalance);

                objSqlParameter[4] = new SqlParameter("@RFID", objBALCust_Registration.RFID);

                objSqlParameter[5] = new SqlParameter("@NicNo", objBALCust_Registration.NicNo);

                objSqlParameter[6] = new SqlParameter("@Name", objBALCust_Registration.Name);

                objSqlParameter[7] = new SqlParameter("@FName", objBALCust_Registration.FName);

                objSqlParameter[8] = new SqlParameter("@CarNo", objBALCust_Registration.CarNo);

                objSqlParameter[9] = new SqlParameter("@CarName", objBALCust_Registration.CarName);

                objSqlParameter[10] = new SqlParameter("@CarManufacturer", objBALCust_Registration.CarManufacturer);

                objSqlParameter[11] = new SqlParameter("@EngineNo", objBALCust_Registration.EngineNo);

                objSqlParameter[12] = new SqlParameter("@ChasisNo", objBALCust_Registration.ChasisNo);

                objSqlParameter[13] = new SqlParameter("@LicenseNo", objBALCust_Registration.LicenseNo);
                #endregion

                 dt = SqlHelper.ExecuteDataset(SqlHelper.SqlCon, CommandType.StoredProcedure, spName, objSqlParameter).Tables[0];
            }
            catch (Exception ex)
            {
                DataRow dr = dt.NewRow();
                dt.Rows.Add(dr);
                dt.Rows[0][0] = 0;
            }
            return dt;
        }