private void FillDepartmentData()
        {
            DataTable dt = null;

            dt = ObjDAL.GetDataCol(clsUtility.DBName + ".dbo.CategoryMaster", "CategoryID,CategoryName", "ISNULL(ActiveStatus,1)=1", "CategoryName ASC");
            cmbCategory.DataSource    = dt;
            cmbCategory.DisplayMember = "CategoryName";
            cmbCategory.ValueMember   = "CategoryID";
            cmbCategory.SelectedIndex = -1;
        }
        private void FillSupplierData()
        {
            DataTable dt = ObjDAL.GetDataCol(clsUtility.DBName + ".dbo.SupplierMaster", "SupplierID,SupplierName", "ISNULL(ActiveStatus,1)=1", "SupplierName ASC");

            cmbSupplier.DataSource    = dt;
            cmbSupplier.DisplayMember = "SupplierName";
            cmbSupplier.ValueMember   = "SupplierID";

            cmbSupplier.SelectedIndex = -1;
        }
Beispiel #3
0
        private void FillSizeTypeData()
        {
            DataTable dt = ObjDAL.GetDataCol(clsUtility.DBName + ".dbo.SizeTypeMaster", "SizeTypeID,SizeTypeName", "ISNULL(ActiveStatus,1)=1", "SizeTypeName ASC");

            if (ObjUtil.ValidateTable(dt))
            {
                cmbSizeType.DataSource    = dt;
                cmbSizeType.DisplayMember = "SizeTypeName";
                cmbSizeType.ValueMember   = "SizeTypeID";
            }
            cmbSizeType.SelectedIndex = -1;
        }
Beispiel #4
0
        private void LoadBranch()
        {
            DataTable dt = ObjDAL.GetDataCol(clsUtility.DBName + ".[dbo].[StoreMaster]", "StoreID,StoreName", "ISNULL(ActiveStatus,1)=1", "StoreName ASC");

            if (ObjUtil.ValidateTable(dt))
            {
                cmbBranch.DataSource    = dt;
                cmbBranch.DisplayMember = "StoreName";
                cmbBranch.ValueMember   = "StoreID";
                cmbBranch.SelectedIndex = -1;
            }
        }
Beispiel #5
0
        private void LoadData()
        {
            DataTable dt = ObjDAL.GetDataCol(clsUtility.DBName + ".dbo.PurchaseInvoice", "PurchaseInvoiceID,SupplierBillNo,SupplierID,ShipmentNo,BillDate,BillValue,TotalQTY,Discount,ForeignExp,GrandTotal,LocalValue,LocalExp,LocalBillValue", "BillDate");

            if (ObjUtil.ValidateTable(dt))
            {
                dataGridView1.DataSource = dt;
            }
            else
            {
                dataGridView1.DataSource = null;
            }
        }
Beispiel #6
0
        private void LoadData()
        {
            DataTable dt = null;

            dt = ObjDAL.GetDataCol(clsUtility.DBName + ".dbo.StoreMaster", "StoreID,StoreName,Tel,Place,Fax,(CASE ActiveStatus WHEN 1 THEN 'Active' WHEN 0 THEN 'InActive' END) ActiveStatus,(CASE StoreCategory WHEN 0 THEN 'Normal Store' WHEN 1 THEN 'Warehouse' END) StoreCategory,StoreCategory [StoreCategoryID] ", "StoreName");
            if (ObjUtil.ValidateTable(dt))
            {
                dataGridView1.DataSource = dt;
            }
            else
            {
                dataGridView1.DataSource = null;
            }
        }
Beispiel #7
0
        private void LoadData()
        {
            DataTable dt = null;

            dt = ObjDAL.GetDataCol(clsUtility.DBName + ".dbo.CustomerMaster", "CustomerID,Name,Address,PhoneNo,(CASE WHEN ActiveStatus =1 THEN 'Active' WHEN ActiveStatus =0 THEN 'InActive' END) ActiveStatus", "Name");

            if (ObjUtil.ValidateTable(dt))
            {
                dgvCustomerMaster.DataSource = dt;
            }
            else
            {
                dgvCustomerMaster.DataSource = null;
            }
        }
Beispiel #8
0
        private void LoadData()
        {
            DataTable dt = null;

            dt = ObjDAL.GetDataCol(clsUtility.DBName + ".dbo.StoreMaster", "StoreID,StoreName,Tel,Place,Fax,(CASE WHEN ActiveStatus =1 THEN 'Active' WHEN ActiveStatus =0 THEN 'InActive' END) ActiveStatus,StoreCategory ", "StoreName");

            if (ObjUtil.ValidateTable(dt))
            {
                dataGridView1.DataSource = dt;
            }
            else
            {
                dataGridView1.DataSource = null;
            }
        }
        private void btnSaveData_Click(object sender, EventArgs e)
        {
            DataTable dt = ObjDAL.GetDataCol(clsUtility.DBName + ".dbo.UserManagement", "UserID,UserName,Password,IsAdmin", "Password='******' AND ISNULL(Isblock,0)=0", "UserID DESC");

            //int a = ObjDAL.ExecuteScalarInt("select Count(*) From CyberCafeManagement.dbo.login where UserName='******' and Password='******'");
            if (ObjUtil.ValidateTable(dt))
            {
                if (Convert.ToBoolean(dt.Rows[0]["IsAdmin"]))
                {
                    IsValidAdmin = true;
                    this.Close();
                }
                else
                {
                    IsValidAdmin = false;
                    clsUtility.ShowInfoMessage("User is not an Admin. Please enter admin password.", clsUtility.strProjectTitle);
                    txtDiscountPass.Focus();
                }
            }
            else
            {
                IsValidAdmin = false;
                clsUtility.ShowInfoMessage("Invalid password..", clsUtility.strProjectTitle);
                txtDiscountPass.Focus();
            }
        }
Beispiel #10
0
        private void LoadData()
        {
            ObjUtil.SetDataGridProperty(dataGridView1, DataGridViewAutoSizeColumnsMode.Fill);
            DataTable dt = null;

            dt = ObjDAL.GetDataCol(clsUtility.DBName + ".dbo.CategoryMaster", "CategoryID,CategoryName,CategoryDescription,(CASE WHEN ActiveStatus =1 THEN 'Active' WHEN ActiveStatus =0 THEN 'InActive' END) ActiveStatus", "CategoryName");

            if (ObjUtil.ValidateTable(dt))
            {
                dataGridView1.DataSource = dt;
            }
            else
            {
                dataGridView1.DataSource = null;
            }
        }
Beispiel #11
0
        private void FillStoreData()
        {
            DataTable dt = ObjDAL.GetDataCol(clsUtility.DBName + ".dbo.StoreMaster", "StoreID,StoreName", "ISNULL(ActiveStatus,1)=1", "StoreName ASC");

            cmbShop.DataSource    = dt;
            cmbShop.DisplayMember = "StoreName";
            cmbShop.ValueMember   = "StoreID";
            cmbShop.SelectedIndex = -1;
        }
        private void FillBrandData()
        {
            DataTable dt = ObjDAL.GetDataCol(clsUtility.DBName + ".dbo.BrandMaster", "BrandID,BrandName", "ISNULL(ActiveStatus,1)=1", "BrandName ASC");

            cmbBrand.DataSource    = dt;
            cmbBrand.DisplayMember = "BrandName";
            cmbBrand.ValueMember   = "BrandID";
            cmbBrand.SelectedIndex = -1;
        }
        private void FillSupplierData()
        {
            int a = 0;

            if (cmbSupplier.SelectedIndex >= 0)
            {
                a = Convert.ToInt32(cmbSupplier.SelectedValue);
            }
            DataTable dt = ObjDAL.GetDataCol(clsUtility.DBName + ".dbo.SupplierMaster", "SupplierID,SupplierName", "ISNULL(ActiveStatus,1)=1", "SupplierName ASC");

            cmbSupplier.DataSource    = dt;
            cmbSupplier.DisplayMember = "SupplierName";
            cmbSupplier.ValueMember   = "SupplierID";

            if (a > 0)
            {
                cmbSupplier.SelectedValue = a;
            }
            else
            {
                cmbSupplier.SelectedIndex = -1;
            }
        }
        private void LoadShop()
        {
            DataTable dt = null;

            dt = ObjCon.GetDataCol(clsUtility.DBName + ".dbo.StoreMaster", "StoreID,StoreName,Place,case StoreCategory when 0 then 'Normal' when 1 then'WearHouse' end as Category ", "StoreName");

            if (ObjUtil.ValidateTable(dt))
            {
                dgvShopeDetails.DataSource = dt;
            }
            else
            {
                dgvShopeDetails.DataSource = null;
            }
        }
Beispiel #15
0
        private void BindStoreDetails()
        {
            DataTable dt = null;

            dt = ObjDAL.GetDataCol(clsUtility.DBName + ".dbo.StoreMaster", "StoreID,StoreName", "ISNULL(ActiveStatus,1)=1", " StoreID");
            cmbShop.DataSource    = dt;
            cmbShop.DisplayMember = "StoreName";
            cmbShop.ValueMember   = "StoreID";
            cmbShop.SelectedIndex = -1;
            // set Default store
            int deafultStoreID = ObjDAL.ExecuteScalarInt("SELECT Storeid FROM " + clsUtility.DBName + ".[dbo].[DefaultStoreSetting] WITH(NOLOCK) WHERE MachineName = '" + Environment.MachineName + "'");

            cmbShop.SelectedValue = deafultStoreID;
            if (deafultStoreID == 0)
            {
                clsUtility.ShowInfoMessage("Please select the default shop for this client.", clsUtility.strProjectTitle);
                this.Close();
            }
        }
Beispiel #16
0
        private void LoadData()
        {
            DataTable dt = null;

            if (admin)
            {
                dt = ObjDAL.ExecuteSelectStatement("SELECT UserID,UserName,[Password],ISNULL(EmailID,'') AS EmailID,SecurityQuestion,Answer,(CASE IsAdmin WHEN 1 THEN 'Admin' WHEN 0 THEN 'Limited User' END)as 'AccountType'" +
                                                   ",(CASE ActiveStatus WHEN 1 THEN 'Active' WHEN 0 THEN 'InActive' END)as 'ActiveStatus'" +
                                                   " FROM " + clsUtility.DBName + ".[dbo].[UserManagement] WITH(NOLOCK)");
            }
            else
            {
                dt = ObjDAL.GetDataCol(clsUtility.DBName + ".dbo.UserManagement", "UserID,UserName,[Password],SecurityQuestion,Answer,ISNULL(EmailID,'') AS EmailID," +
                                       "(CASE IsAdmin WHEN 1 THEN 'Admin' WHEN 0 THEN 'Limited User' END)as 'AccountType',(CASE ActiveStatus WHEN 1 THEN 'Active' WHEN 0 THEN 'InActive' END)as 'ActiveStatus'", "UserID=" + LogID, "UserID");
            }
            if (ObjUtil.ValidateTable(dt))
            {
                dataGridView1.DataSource = dt;
            }
            else
            {
                dataGridView1.DataSource = null;
            }
        }
Beispiel #17
0
        private void InsertClientRegistration()
        {
            //clsConnection_DAL ObjDAL = new clsConnection_DAL(true);
            DataTable dt = ObjDAL.GetDataCol(ClientDBName + ".dbo.RegistrationDetails", "[SoftKey],[ExpiryDate],[StatusDate]", "ISNULL([IsServer],0) = 1 AND ISNULL([IsKeyEnter],0) = 1", null);

            if (ObjUtil.ValidateTable(dt))
            {
                ObjDAL.SetColumnData("PcName", SqlDbType.NVarChar, Environment.MachineName);
                ObjDAL.SetColumnData("StatusDate", SqlDbType.VarChar, dt.Rows[0]["StatusDate"].ToString());
                ObjDAL.SetColumnData("SoftKey", SqlDbType.VarChar, dt.Rows[0]["SoftKey"].ToString());
                ObjDAL.SetColumnData("IsTrail", SqlDbType.Bit, 0);
                ObjDAL.SetColumnData("RegDate", SqlDbType.Date, DateTime.Now);
                ObjDAL.SetColumnData("ExpiryDate", SqlDbType.VarChar, dt.Rows[0]["ExpiryDate"].ToString());
                ObjDAL.SetColumnData("IsKeyEnter", SqlDbType.Bit, 1);

                if (ObjDAL.InsertData(ClientDBName + ".dbo.RegistrationDetails", true) > 0)
                {
                    ObjDAL.ResetData();
                    clsUtility.ShowInfoMessage("Client Registration is successfully", clsUtility.strProjectTitle);
                    //System.Diagnostics.Process.Start(exeName + ".exe");
                    Application.Exit();
                }
            }
        }
Beispiel #18
0
 private bool ValidateLogin(string username, string password)
 {
     if (username.Equals("admin") && password.Equals("admin") && count <= 3)
     {
         count++;
     }
     if (username.Equals("admin") && password.Equals("admin") && count == 3)
     {
         clsUtility.LoginID = 0;
         clsUtility.IsAdmin = true;
         return(true);
     }
     else if (!(username.Equals("admin") && password.Equals("admin")))
     {
         try
         {
             DataTable dt = ObjDAL.GetDataCol(clsUtility.DBName + ".dbo.UserManagement", "UserID,UserName,Password,IsAdmin", "UserName='******' AND Password='******' and ISNULL(Isblock,0)=0", "UserID DESC");
             //int a = ObjDAL.ExecuteScalarInt("select Count(*) From CyberCafeManagement.dbo.login where UserName='******' and Password='******'");
             if (dt != null && dt.Rows.Count > 0)
             {
                 clsUtility.LoginID = Convert.ToInt32(dt.Rows[0]["UserID"]);
                 clsUtility.IsAdmin = Convert.ToBoolean(dt.Rows[0]["IsAdmin"]);
                 return(true);
             }
             else
             {
                 return(false);
             }
         }
         catch
         {
             return(false);
         }
     }
     return(false);
 }
Beispiel #19
0
        private bool FormValidation()
        {
            string ValidatingEmailID = txtEmail.Text.Trim();

            if (ObjUtil.IsControlTextEmpty(txtUserName))
            {
                clsUtility.ShowInfoMessage("Enter UserName.", clsUtility.strProjectTitle);
                txtUserName.Focus();
                return(false);
            }

            else if (ObjUtil.IsControlTextEmpty(txtEmail))
            {
                clsUtility.ShowInfoMessage("Enter E-Mail Address.", clsUtility.strProjectTitle);
                txtEmail.Focus();
                return(false);
            }
            else if (!ObjUtil.ValidateEmail(ValidatingEmailID))
            {
                clsUtility.ShowInfoMessage("Enter Valid E-Mail Address.", clsUtility.strProjectTitle);
                txtEmail.Focus();
                return(false);
            }
            else if (ObjUtil.IsControlTextEmpty(cmbSecurity))
            {
                clsUtility.ShowInfoMessage("Select Security question for password retrival.", clsUtility.strProjectTitle);
                cmbSecurity.Focus();
                return(false);
            }
            else if (ObjUtil.IsControlTextEmpty(txtAsnwer))
            {
                clsUtility.ShowInfoMessage("Enter Security's question.", clsUtility.strProjectTitle);
                txtAsnwer.Focus();
                return(false);
            }
            else
            {
                dt = ObjDAL.GetDataCol(clsUtility.DBName + ".dbo.UserManagement", "[UserName],[SecurityQuestion],[Answer],[Password],EmailID", "UserName='******'", null);
                if (ObjUtil.ValidateTable(dt))
                {
                    string SecurityQuestion, Answer, Password, EmailID;

                    SecurityQuestion = dt.Rows[0]["SecurityQuestion"].ToString();
                    Answer           = ObjUtil.Decrypt(dt.Rows[0]["Answer"].ToString(), true);
                    Password         = dt.Rows[0]["Password"].ToString();
                    EmailID          = dt.Rows[0]["EmailID"].ToString();

                    if (SecurityQuestion == cmbSecurity.SelectedItem.ToString() && Answer.ToLower() == txtAsnwer.Text.ToLower() && EmailID.ToLower() == txtEmail.Text.ToLower())
                    {
                        txtRetrivePassword.Text = ObjUtil.Decrypt(Password, true);
                    }
                    else
                    {
                        clsUtility.ShowInfoMessage("Entered details is not matching.", clsUtility.strProjectTitle);
                        return(false);
                    }
                }
                else
                {
                    clsUtility.ShowInfoMessage("Entered UserName or EmailID is not exist.", clsUtility.strProjectTitle);
                    return(false);
                }
                return(true);
            }
        }