示例#1
0
        private void udmPRODUCT_AddtoCart()
        {
            DataTable dt = TableHeadingName();

            DataRow row = dt.NewRow();     //NewRow

            //Header_Names
            row["Product_ID"]            = Convert.ToString(labelProduct_ID.Text);
            row["CategoryName"]          = Convert.ToString(cbProductCategory.Text);
            row["ProductType"]           = Convert.ToString(cbProductType.Text);
            row["ProductBrand"]          = Convert.ToString(cbProductBrand.Text);
            row["ProductSize"]           = Convert.ToString(cbProductSize.Text);
            row["ProductColor"]          = Convert.ToString(cbProductColour.Text);
            row["SalesProductUnitPrice"] = Convert.ToInt32(tbProductUnitPrice.Text);
            row["SalesProductQty"]       = Convert.ToInt32(tbProductQty.Text);
            row["SalesProductTotal"]     = Convert.ToInt32(tbProductTotalPrice.Text);

            //RealTime_From_Database
            // bool Status = false; string StatusDetails = null;
            // DataTable dtCheckStockQty = MainClass.POS.usp_GetByBarcode(tbSearchBarcode.Text.ToString(), out Status, out StatusDetails);

            dt.Rows.Add(row);     //NewRow_AddInDataTable

            foreach (DataRow r in dt.Rows)
            {     //Array ValueParams
                gridViewPRODUCT.Rows.Add(r["Product_ID"].ToString(),
                                         r["CategoryName"].ToString(), r["ProductType"].ToString(), r["ProductBrand"].ToString(),
                                         r["ProductSize"].ToString(), r["ProductColor"].ToString(), r["SalesProductUnitPrice"].ToString(),
                                         r["SalesProductQty"].ToString(), r["SalesProductTotal"].ToString());
            }
            dt.AcceptChanges();

            //Stock Plus_Minus
            int labelPID = Convert.ToInt32(labelProduct_ID.Text);

            if (gridViewPRODUCT.Rows.Count >= 1)
            {
                //--Method_1
                var SumValue = gridViewPRODUCT.Rows.Cast <DataGridViewRow>()
                               .Where(r => r.Cells["Product_ID"].Value.ToString() == labelPID.ToString())
                               .Select(r => r.Cells["Qty"].Value);

                tbProductAvailableQty.Text = Convert.ToString(Convert.ToInt32(tbProductAvailableQty.Text) - Convert.ToInt32(SumValue.LastOrDefault()));
                if (Convert.ToInt32(tbProductQty.Text) <= 0 || tbProductQty.Text == null)
                {
                    //Stock Plus_Minus
                    gridViewPRODUCT.Rows.RemoveAt(gridViewPRODUCT.Rows[gridViewPRODUCT.RowCount - 1].Index);
                    JIMessageBox.ErrorMessage("Please Select Qty !");
                    tbProductQty.Focus();
                    return;
                }
                else
                {
                    tbProductQty.Text = "0";
                }
            }

            //__GrandTotal__
            udmGrandTotal();
        }
示例#2
0
        private void btnCadetRegister_Click(object sender, EventArgs e)
        {
            bool   Status        = false;
            string StatusDetails = null;

            try
            {
                if (textBoxCategoryName.Text == "" || textBoxCategoryName.Text == null)
                {
                    JIMessageBox.ExclamationMessage("Please Fill Field! \n Thank You"); return;
                }
                ;
                string CategoryName = textBoxCategoryName.Text;
                MainClass.POS.CRUDCategoryCreate(CategoryName, out Status, out StatusDetails);
                if (Status)
                {
                    MessageBox.Show(StatusDetails, "Information", MessageBoxButtons.OK, MessageBoxIcon.Information);
                    textBoxCategoryName.Text = "";
                    displayCategory();
                    textBoxCategoryName.Focus();
                }
                else
                {
                    MessageBox.Show(StatusDetails, "Warning", MessageBoxButtons.OK, MessageBoxIcon.Warning);
                }
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message);
            }
        }
示例#3
0
        private void buttonDelete_Click(object sender, EventArgs e)
        {
            bool   Status        = false;
            string StatusDetails = null;

            try
            {
                if (textBoxCategoryName.Text == "" || textBoxCategoryName.Text == null)
                {
                    JIMessageBox.ExclamationMessage("Please Fill Field! \n Thank You"); return;
                }
                ;
                ModelClass.ModelPOS.ModelCategory mCategory = new ModelClass.ModelPOS.ModelCategory()
                {
                    CategoryID = int.Parse(labelCategoryID.Text), CategoryName = textBoxCategoryName.Text
                };
                MainClass.POS.CRUDCategoryDelete(mCategory, out Status, out StatusDetails);
                if (Status)
                {
                    MessageBox.Show(StatusDetails, "Information", MessageBoxButtons.OK, MessageBoxIcon.Information);
                    displayCategory();
                }
                else
                {
                    MessageBox.Show(StatusDetails, "Warning", MessageBoxButtons.OK, MessageBoxIcon.Warning);
                }
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message);
            }
        }
示例#4
0
        private void createUser()
        {
            bool   Status        = false;
            string StatusDetails = null;

            try
            {
                ModelClass.ModelPOS.ModelUser md = new ModelClass.ModelPOS.ModelUser();
                md.Role_ID          = int.Parse(cbRoles.SelectedValue.ToString());
                md.UserName         = tbName.Text.ToString();
                md.UserPassword     = tbPassword.Text.ToString();
                md.ContactNo        = tbphone.Text.ToString();
                md.UserDesignation  = tbDesignation.Text.ToString();
                md.CreatedByUser_ID = ModelClass._UserID;                //UserID_Static
                Bitmap img   = ImageClass.Resize((Bitmap)pictureBoxUser.Image, new Size(200, 200), System.Drawing.Imaging.ImageFormat.Jpeg);
                string Photo = ImageClass.GetBase64StringFromImage(img); //Resize & Convert to String
                md.UserPicture = Photo;
                MainClass.POS.CRUDUserCreate(md, out Status, out StatusDetails);
                if (Status)
                {
                    JIMessageBox.InformationMessage(StatusDetails);
                    Clear();
                }
                else
                {
                    MessageBox.Show(StatusDetails, "Warning", MessageBoxButtons.OK, MessageBoxIcon.Warning);
                }
                gridViewUser.Rows.Clear();
                displayUser();
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message);
            }
        }
示例#5
0
 private void buttonSubmit_Click(object sender, EventArgs e)
 {
     try
     {
         if (tbInvoice.Text == "" || tbCustomerName.Text == "")
         {
             JIMessageBox.ExclamationMessage("Please Fill Invoice No & Customer Name !"); return;
         }
         bool   Status        = false;
         string StatusDetails = null;
         int    SalesOrderID  = 0;
         if (gridViewPRODUCT.Rows.Count > 0 && gridViewPICTURE.Rows.Count > 0) //Both
         {
             udm_PictureANDProductAddToDatabaseBOTH(Status, StatusDetails, SalesOrderID);
         }
         else if (gridViewPRODUCT.Rows.Count >= 1 && gridViewPICTURE.Rows.Count <= 0) //Product
         {
             udm_OnlyProductAddToDatabase(Status, StatusDetails, SalesOrderID);
         }
         else
         if (gridViewPICTURE.Rows.Count >= 1 && gridViewPRODUCT.Rows.Count <= 0)   //Picture
         {
             udm_OnlyPicureAddToDatabase(Status, StatusDetails, SalesOrderID);
         }
         else
         {
             JIMessageBox.ExclamationMessage("Cart is Empty !");
         }
     }
     catch (Exception ex)
     {
         JIMessageBox.ErrorMessage(ex.ToString());
     }
 }
示例#6
0
        private void buttonUpdateProduct_Click(object sender, EventArgs e)
        {
            bool   Status        = false;
            string StatusDetails = null;

            try
            {
                if (comboBocCategory.Text == "" || textBoxProductType.Text == "" || textBoxBrand.Text == "" ||
                    textBoxSize.Text == "" || textBoxColour.Text == "" || textBoxBarcode.Text == "")
                {
                    JIMessageBox.ExclamationMessage("Fill All Fields !"); return;
                }
                string Photo = ImageClass.GetBase64StringFromImage(Imager.Resize(pictureBoxProduct.Image, 200, 200, true)); //Resize & Convert to String

                MainClass.POS.usp_UpdateProduct(Convert.ToInt32(labelProductID.Text),
                                                Convert.ToInt32(comboBocCategory.SelectedValue), textBoxProductType.Text,
                                                textBoxBrand.Text, textBoxSize.Text, textBoxColour.Text, Photo, textBoxBarcode.Text,
                                                out Status, out StatusDetails);
                if (Status)
                {
                    JIMessageBox.InformationMessage("Record Updated Succesfully !");
                    displayProduct();
                    //  clearTextBox();
                }
                else
                {
                    MessageBox.Show(StatusDetails, "Warning", MessageBoxButtons.OK, MessageBoxIcon.Warning);
                }
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message);
            }
        }
示例#7
0
 private void tbProductQty_Leave(object sender, EventArgs e)
 {
     try
     {
         //tbProductAvailableQty
         if (tbProductAvailableQty.Text == null || tbProductAvailableQty.Text == "")
         {
             JIMessageBox.ExclamationMessage("Available Stock Field is Empty !");
             return;
         }
         {
             try
             {
                 if (Convert.ToInt32(tbProductQty.Text) > Convert.ToInt32(tbProductAvailableQty.Text))
                 {
                     JIMessageBox.AsteriskMessage("Available Stock is :  " + tbProductAvailableQty.Text + " !");
                     tbProductQty.Focus();
                 }
             }
             catch (Exception)
             {
                 tbProductQty.Focus();
                 JIMessageBox.ErrorMessage("Please Enter Digit !");
             }
         }
     }
     catch (Exception ex)
     {
         MessageBox.Show(ex.Message);
         tbAdvance.Focus();
     }
 }
示例#8
0
        private bool IsFormValidated()
        {
            if (BranchNameTextBox.Text.Trim() == string.Empty)
            {
                JIMessageBox.ShowErrorMessage("Branch Name is required.");

                //MessageBox.Show("Branch Name is required", "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
                BranchNameTextBox.Focus();
                return(false);
            }

            if (EmailTextBox.Text.Trim() == string.Empty)
            {
                JIMessageBox.ShowErrorMessage("Email is required");
                //MessageBox.Show("Email is required", "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
                //EmailTextBox.Focus();
                return(false);
            }

            if (MobileTextBox.Text.Trim() == string.Empty)
            {
                JIMessageBox.ShowErrorMessage("Mobile is required");
                //MessageBox.Show("Mobile is required", "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
                //MobileTextBox.Focus();
                return(false);
            }
            return(true);
        }
示例#9
0
        private void gridViewProduct_CellClick(object sender, DataGridViewCellEventArgs e)
        {
            try
            {
                if (e.RowIndex >= 0)
                {
                    DataGridViewRow Row = this.gridViewProduct.Rows[e.RowIndex];

                    labelProductID.Text     = Row.Cells["ProductID"].Value.ToString();
                    comboBocCategory.Text   = Row.Cells["CategoryName"].Value.ToString();
                    textBoxProductType.Text = Row.Cells["ProductType"].Value.ToString();
                    textBoxBrand.Text       = Row.Cells["ProductBrand"].Value.ToString();
                    textBoxSize.Text        = Row.Cells["ProductSize"].Value.ToString();
                    textBoxColour.Text      = Row.Cells["ProductColor"].Value.ToString();
                    textBoxBarcode.Text     = Row.Cells["Barcode"].Value.ToString();
                    string pImage = Row.Cells["ProductImage"].Value.ToString();
                    if (pImage == "ImageClass.GetImageFromBase64(Row.Cells[ProductImage].Value.ToString())' threw an exception of type 'System.FormatException" || pImage == "" || pImage == "NoImage")
                    {
                        pictureBoxProduct.Visible     = false;
                        labelAfterHiddenImage.Visible = true;
                        labelAfterHiddenImage.Text    = "NoImage";
                    }
                    else
                    {
                        pictureBoxProduct.Visible     = true;
                        labelAfterHiddenImage.Visible = false;
                        pictureBoxProduct.Image       = ImageClass.GetImageFromBase64(Row.Cells["ProductImage"].Value.ToString());
                    }
                }
            }
            catch (Exception ex)
            {
                JIMessageBox.ErrorMessage(ex.Message);
            }
        }
        private void textBoxPurchaseUnitPrice_Leave(object sender, EventArgs e)
        {
            try
            {
                if (Convert.ToInt32(textBoxPurchaseUnitPrice.Text) <= 0)
                {
                    JIMessageBox.ExclamationMessage("Purchase Unit Price Field is less then 1 !");
                    textBoxPurchaseUnitPrice.Focus();
                    return;
                }
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message);
                textBoxPurchaseUnitPrice.Focus();
                return;
            }



            //public bool checkValidation()
            //{
            //   if( cbCategory.Text == null &&
            //    cbType.Text == null &&
            //    cbBrand.Text == null &&
            //    cbSize.Text == null &&
            //    cbColor.Text == null &&
            //    textBoxBarcode.Text = null
            //    ) { }
            //}
        }
示例#11
0
        private void createSupplier()
        {
            bool   Status        = false;
            string StatusDetails = null;

            ModelClass.ModelPOS.ModelSupplier mp = new ModelClass.ModelPOS.ModelSupplier()
            {
                SupplierName     = textBoxName.Text,
                SupplierPhoneNo  = textBoxPhone.Text,
                SupplierMobileNo = textBoxMobile.Text,
                SupplierAddress  = textBoxAddress.Text,
            };

            string Photo = ImageClass.GetBase64StringFromImage(Imager.Resize(pictureBoxSupplier.Image, 200, 200, true)); //Resize & Convert to String

            mp.SupplierPicture = Photo;
            MainClass.POS.CRUDSuppierCreate(mp, out Status, out StatusDetails);
            if (Status)
            {
                JIMessageBox.InformationMessage(StatusDetails);
                clearTextbox();
            }
            else
            {
                MessageBox.Show(StatusDetails, "Warning", MessageBoxButtons.OK, MessageBoxIcon.Warning);
            }
            gridViewSupplier.Rows.Clear();
        }
        private void updatePurchase()
        {
            bool   Status        = false;
            string StatusDetails = null;

            try
            {
                ModelClass.ModelPOS.ModelPurchaseNStock md = new ModelClass.ModelPOS.ModelPurchaseNStock();

                MainClass.POS.usp_UpdatePurchaseWithStock(Convert.ToInt32(textBoxQty.Text), Convert.ToInt32(textBoxActualPrice.Text), Convert.ToInt32(textBoxPurchaseUnitPrice.Text),
                                                          Convert.ToInt32(textBoxPurchaseTotalPrice.Text), textBoxBarcode.Text, dtPurchase.Value, Convert.ToInt32(cbSupplier.SelectedValue.ToString()), Convert.ToInt32(labelPurchaseID.Text), out Status, out StatusDetails);
                if (Status)
                {
                    JIMessageBox.InformationMessage(StatusDetails);
                    Clear();
                    gridViewPurchase.Rows.Clear();
                    displayPurchase();
                }
                else
                {
                    MessageBox.Show(StatusDetails, "Warning", MessageBoxButtons.OK, MessageBoxIcon.Warning);
                }
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message);
            }
        }
        private void btnBackup_Click(object sender, EventArgs e)
        {
            string database = con.Database.ToString();

            try
            {
                if (pathtext.Text == string.Empty)
                {
                    MessageBox.Show("please select the path for backup");
                }
                else
                {
                    string cmd = "BACKUP DATABASE [" + database + "] TO DISK='" + pathtext.Text + "\\" + "database" + "-" + DateTime.Now.ToString("yyyy-MM-dd--HH-mm-ss") + ".bak'";
                    using (SqlCommand command = new SqlCommand(cmd, con))
                    {
                        if (con.State != ConnectionState.Open)
                        {
                            con.Open();
                        }
                        command.ExecuteNonQuery();
                        con.Close();
                        MessageBox.Show("Database backup created Successfully");
                        btnBackup.Enabled = false;
                        pathtext.Clear();
                    }
                }
            }
            catch (Exception ex)
            {
                JIMessageBox.ExclamationMessage(ex.Message);
            }
        }
示例#14
0
 private void udmPicFieldValidation()
 {
     if (cbPicCategory.Text == "")
     {
         JIMessageBox.ExclamationMessage("Please Select " + cbPicCategory.Text + " !"); return;
     }
     if (cbPicType.Text == "")
     {
         JIMessageBox.ExclamationMessage("Please Select Type !"); return;
     }
     if (cbPicBrand.Text == "")
     {
         JIMessageBox.ExclamationMessage("Please Select Brand !"); return;
     }
     if (tbPicNumber.Text == "")
     {
         JIMessageBox.ExclamationMessage("Please Select Picture No !"); return;
     }
     if (tbPicUnitPrice.Text == "")
     {
         JIMessageBox.ExclamationMessage("Please Select UnitPrice !"); return;
     }
     if (tbPicQty.Text == "")
     {
         JIMessageBox.ExclamationMessage("Please Select Qty !"); return;
     }
     if (tbPicTotalPrice.Text == "")
     {
         JIMessageBox.ExclamationMessage("Please Select Total Price !"); return;
     }
 }
        private void udmSearchFromBarcode()
        {
            bool   Status        = false;
            string StatusDetails = null;

            try
            {
                mp.BarCode = textBoxSearchBarcode.Text.ToString();

                DataTable dt = MainClass.POS.usp_GetProduct_withoutImage(mp, out Status, out StatusDetails);
                if (Status && dt.Rows.Count > 0)
                {
                    mp.ProductID                   = int.Parse(dt.Rows[0]["ProductID"].ToString());
                    cbCategory.Text                = dt.Rows[0]["CategoryName"].ToString();
                    cbType.Text                    = dt.Rows[0]["ProductType"].ToString();
                    cbBrand.Text                   = dt.Rows[0]["ProductBrand"].ToString();
                    cbSize.Text                    = dt.Rows[0]["ProductSize"].ToString();
                    cbColor.Text                   = dt.Rows[0]["ProductColor"].ToString();
                    textBoxBarcode.Text            = dt.Rows[0]["BarCode"].ToString();
                    textBoxActualPrice.Text        = "";
                    textBoxPurchaseUnitPrice.Text  = "";
                    textBoxQty.Text                = "";
                    textBoxPurchaseTotalPrice.Text = "";
                    DataTable ddt = MainClass.POS.usp_GetProduct_withImage(mp, out Status, out StatusDetails);
                    if (Status)
                    {
                        string pImage = ddt.Rows[0]["ProductPicture"].ToString();
                        if (pImage == "ImageClass.GetImageFromBase64(Row.Cells[ProductPicture].Value.ToString())' threw an exception of type 'System.FormatException" || pImage == "" || pImage == "NoImage")
                        {
                            pictureBoxPurchase.Visible    = false;
                            labelAfterHiddenImage.Visible = true;
                            labelAfterHiddenImage.Text    = "NoImage";
                        }
                        else
                        {
                            pictureBoxPurchase.Visible    = true;
                            labelAfterHiddenImage.Visible = false;
                            pictureBoxPurchase.Image      = ImageClass.GetImageFromBase64(ddt.Rows[0]["ProductPicture"].ToString());
                        }
                        udmGetQtySumFromGridViewDown();
                    }
                    else
                    {
                        MessageBox.Show(StatusDetails, "Warning", MessageBoxButtons.OK, MessageBoxIcon.Warning);
                    }
                }
                else
                {
                    JIMessageBox.InformationMessage("Invalid Barcode !");
                }
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message);
            }
        }
示例#16
0
 private void buttonAddProduct_Click(object sender, EventArgs e)
 {
     if (comboBocCategory.Text == "" || textBoxProductType.Text == "" || textBoxBrand.Text == "" ||
         textBoxSize.Text == "" || textBoxColour.Text == "" || textBoxBarcode.Text == "")
     {
         JIMessageBox.ExclamationMessage("Fill All Fields !"); return;
     }
     createProduct();
     displayProduct();
 }
示例#17
0
        private void tbInvoice_Leave(object sender, EventArgs e)
        {
            DataTable dt = MainClass.POS.usp_CheckInvoiceNoIfExists();

            for (int i = 0; i < dt.Rows.Count; i++)
            {
                if (tbInvoice.Text == dt.Rows[i][0].ToString())
                {
                    JIMessageBox.ErrorMessage("Invoice Number is Already Exists !");
                    tbInvoice.Focus();
                }
            }
        }
示例#18
0
 private void tbProductAvailableQty_TextChanged(object sender, EventArgs e)
 {
     if (Convert.ToInt32(tbProductAvailableQty.Text) == 0)
     {
         tbProductAvailableQty.Text = "0";
     }
     if (Convert.ToInt32(tbProductAvailableQty.Text) < -1)
     {
         tbProductAvailableQty.Text = "0";
         JIMessageBox.WarningMessage("More Stock Not Available");
         return;
     }
 }
        private void buttonUpdateInvoice_Click(object sender, EventArgs e)
        {
            bool   Status        = false;
            string StatusDetails = null;

            try
            {
                if (tbSearchInvocie.Text == "")
                {
                    JIMessageBox.ExclamationMessage("Please Enter Invoice Number"); return;
                }
                if (tbSearchInvocie.Text != "")
                {
                    if (tbCustomerName.Text == "")
                    {
                        JIMessageBox.ExclamationMessage("Details Not Available !"); return;
                    }
                }


                MainClass.POS.usp_UpdateCustomer(Convert.ToInt32(labelCustomerID.Text), tbCustomerName.Text, tbContact.Text, rtbDetails.Text, out Status, out StatusDetails);
                if (Status == false)
                {
                    JIMessageBox.WarningMessage(StatusDetails);
                }
                else
                {
                    //CODE
                }

                //dtCurrentDate.Value = dtCurrentDate.Value == null ? DateTime.Now : dtCurrentDate.Value;
                //dtDueDate.Value = dtDueDate.Value == null ? DateTime.Now : dtDueDate.Value;
                MainClass.POS.UpdateSalesOrder(
                    Convert.ToInt32(labelSalesOrderID.Text), dtCurrentDate.Value, dtDueDate.Value,
                    Convert.ToInt32(tbGrandTotal.Text), Convert.ToInt32(tbAdvance.Text),
                    Convert.ToInt32(tbBalance.Text), tbSearchInvocie.Text,
                    out Status, out StatusDetails);
                if (Status == false)
                {
                    JIMessageBox.WarningMessage(StatusDetails);
                }
                else
                {
                    JIMessageBox.InformationMessage("Record Updated Successfully !");
                }
            }
            catch (Exception ex)
            {
                JIMessageBox.WarningMessage(ex.ToString());
            }
        }
        private void gridViewAvailableStock_CellClick(object sender, DataGridViewCellEventArgs e)
        {
            try
            {
                bool   Status        = false;
                string StatusDetails = null;
                if (e.RowIndex >= 0)
                {
                    DataGridViewRow Row = this.gridViewAvailableStock.Rows[e.RowIndex];
                    labelBarcode.Text        = Row.Cells["Barcode"].Value.ToString();
                    labelCategory.Text       = Row.Cells["CategoryName"].Value.ToString();
                    labelType.Text           = Row.Cells["ProductType"].Value.ToString();
                    labelBrand.Text          = Row.Cells["ProductBrand"].Value.ToString();
                    labelSize.Text           = Row.Cells["ProductSize"].Value.ToString();
                    labelColor.Text          = Row.Cells["ProductColor"].Value.ToString();
                    labelDate.Text           = Row.Cells["PurchaseDate"].Value.ToString();
                    labelAvailableStock.Text = Row.Cells["AvailableQty"].Value.ToString();
                    labelCousumeStock.Text   = Row.Cells["SoldQty"].Value.ToString();

                    ModelProduct mp = new ModelProduct();
                    mp.ProductID = Convert.ToInt32(Row.Cells["ProductID"].Value.ToString());
                    DataTable ddt = MainClass.POS.usp_GetProduct_withImage(mp, out Status, out StatusDetails);
                    if (Status)
                    {
                        string pImage = ddt.Rows[0]["ProductPicture"].ToString();
                        if (pImage == "ImageClass.GetImageFromBase64(Row.Cells[ProductImage].Value.ToString())' threw an exception of type 'System.FormatException" || pImage == "" || pImage == "NoImage")
                        {
                            labelAfterHiddenImage.Visible = true;
                            labelAfterHiddenImage.Text    = "NoImage";
                            pictureBoxAvailable.Visible   = false;
                        }
                        else
                        {
                            pictureBoxAvailable.Visible   = true;
                            labelAfterHiddenImage.Visible = false;
                            pictureBoxAvailable.Image     = ImageClass.GetImageFromBase64(ddt.Rows[0]["ProductPicture"].ToString());
                        }
                        udmGetQtySumFromGridViewDown();
                    }
                    else
                    {
                        MessageBox.Show(StatusDetails, "Warning", MessageBoxButtons.OK, MessageBoxIcon.Warning);
                    }
                }
            }
            catch (Exception ex)
            {
                JIMessageBox.ErrorMessage(ex.Message);
            }
        }
示例#21
0
 private void buttonShowAll_Click(object sender, EventArgs e)
 {
     try
     {
         foreach (DataGridViewRow row in gridViewExpenses.Rows)
         {
             row.Visible = true;
         }
     }
     catch (Exception ex)
     {
         JIMessageBox.ErrorMessage(ex.ToString());
     }
 }
示例#22
0
 private void gridViewProduct_KeyDown(object sender, KeyEventArgs e)
 {
     try
     {
         if (e.KeyCode == Keys.Down)
         {
             udmKeyPress();
         }
     }
     catch (Exception ex)
     {
         JIMessageBox.ErrorMessage(ex.Message);
     }
 }
        private void btnCadetRegister_Click(object sender, EventArgs e)
        {
            if (textBoxBarcode.Text == "" || textBoxBarcode.Text == null)
            {
                JIMessageBox.ExclamationMessage("Enter Barcode First!");
                return;
            }
            if (textBoxPurchaseUnitPrice.Text == "" || textBoxQty.Text == "" || cbSupplier.Text == "")
            {
                JIMessageBox.ExclamationMessage("Please Fill All Fields !");
                return;
            }

            createPurchase();
        }
示例#24
0
 private void displayComboBox()
 {
     try
     {
         DataTable DTCategory = MainClass.POS.GetRoles();
         if (DTCategory.Rows.Count > 0)
         {
             ListData.AutoSuggession_With_ComboBox(DTCategory, "RoleID", cbRoles, "RoleID", "RoleName");
         }
     }
     catch (Exception ex)
     {
         JIMessageBox.ErrorMessage(ex.Message);
     }
 }
示例#25
0
        private void udm_OnlyPicureAddToDatabaseBOTH(bool status, string statusDetails, int salesOrderID)
        {
            bool   Status        = false;
            string StatusDetails = null;
            int    SalesOrderID  = 0;


            if (Status)
            {
            }    //usp_InsertSalesOrder
            else
            {
                JIMessageBox.InformationMessage("ERROR Fom Database:  " + StatusDetails);
                return;
            }
        }
        private void udmKeyPress()
        {
            try
            {
                bool   Status        = false;
                string StatusDetails = null;

                // Getting Index of Current Row
                int             index = gridViewAvailableStock.CurrentRow.Index;
                DataGridViewRow Row   = this.gridViewAvailableStock.Rows[index];

                labelBarcode.Text        = Row.Cells["Barcode"].Value.ToString();
                labelCategory.Text       = Row.Cells["CategoryName"].Value.ToString();
                labelType.Text           = Row.Cells["ProductType"].Value.ToString();
                labelBrand.Text          = Row.Cells["ProductBrand"].Value.ToString();
                labelSize.Text           = Row.Cells["ProductSize"].Value.ToString();
                labelColor.Text          = Row.Cells["ProductColor"].Value.ToString();
                labelDate.Text           = Row.Cells["PurchaseDate"].Value.ToString();
                labelAvailableStock.Text = Row.Cells["AvailableQty"].Value.ToString();
                labelCousumeStock.Text   = Row.Cells["SoldQty"].Value.ToString();

                ModelProduct mp = new ModelProduct();
                mp.ProductID = Convert.ToInt32(Row.Cells["ProductID"].Value.ToString());
                DataTable ddt = MainClass.POS.usp_GetProduct_withImage(mp, out Status, out StatusDetails);
                if (Status)
                {
                    string pImage = ddt.Rows[0]["ProductPicture"].ToString();
                    if (pImage == "ImageClass.GetImageFromBase64(Row.Cells[ProductImage].Value.ToString())' threw an exception of type 'System.FormatException" || pImage == "" || pImage == "NoImage")
                    {
                        labelAfterHiddenImage.Visible = true;
                        labelAfterHiddenImage.Text    = "NoImage";
                        pictureBoxAvailable.Visible   = false;
                    }
                    else
                    {
                        pictureBoxAvailable.Visible   = true;
                        labelAfterHiddenImage.Visible = false;
                        pictureBoxAvailable.Image     = ImageClass.GetImageFromBase64(ddt.Rows[0]["ProductPicture"].ToString());
                    }
                    udmGetQtySumFromGridViewDown();
                }
            }
            catch (Exception ex)
            {
                JIMessageBox.ErrorMessage(ex.Message);
            }
        }
        private void displayComboBox()
        {
            try
            {
                DataTable DTCategory = MainClass.POS.GetCategoryDISTINCT();
                if (DTCategory.Rows.Count > 0)
                {
                    ListData.AutoSuggession_With_ComboBox(DTCategory, "CategoryName", cbCategory, "CategoryName", "CategoryName");
                }

                DataTable DTType = MainClass.POS.GetProductTypeDISTINCT();
                if (DTType.Rows.Count > 0)
                {
                    ListData.AutoSuggession_With_ComboBox(DTType, "ProductType", cbType, "ProductType", "ProductType");
                }

                DataTable DTBrand = MainClass.POS.GetProductBrandDISTINCT();
                if (DTBrand.Rows.Count > 0)
                {
                    ListData.AutoSuggession_With_ComboBox(DTBrand, "ProductBrand", cbBrand, "ProductBrand", "ProductBrand");
                }

                DataTable DTSize = MainClass.POS.GetProductSizeDISTINCT();
                if (DTSize.Rows.Count > 0)
                {
                    ListData.AutoSuggession_With_ComboBox(DTSize, "ProductSize", cbSize, "ProductSize", "ProductSize");
                }

                DataTable DTColor = MainClass.POS.GetProductColorDISTINCT();
                if (DTColor.Rows.Count > 0)
                {
                    ListData.AutoSuggession_With_ComboBox(DTColor, "ProductColor", cbColor, "ProductColor", "ProductColor");
                }

                DataTable DTSupplier = MainClass.POS.GetSupplier();
                if (DTColor.Rows.Count > 0)
                {
                    ListData.AutoSuggession_With_ComboBox(DTSupplier, "SupplierID", cbSupplier, "SupplierID", "SupplierName");
                }
            }
            catch (Exception ex)
            {
                JIMessageBox.ErrorMessage(ex.Message);
            }
        }
 private void textBoxQty_Leave(object sender, EventArgs e)
 {
     try
     {
         if (Convert.ToInt32(textBoxQty.Text) <= 0)
         {
             JIMessageBox.ExclamationMessage("Purchase Qty Field is less then 1 !");
             textBoxQty.Focus();
             return;
         }
     }
     catch (Exception ex)
     {
         MessageBox.Show(ex.Message);
         textBoxPurchaseUnitPrice.Focus();
         return;
     }
 }
示例#29
0
        private void createProduct()
        {
            bool   Status        = false;
            string StatusDetails = null;

            try
            {
                if (JIMessageBox.CheckisFieldsFill(textBoxBarcode.Text))
                {
                    ModelClass.ModelPOS.ModelProduct mp = new ModelClass.ModelPOS.ModelProduct()
                    {
                        Category_ID      = int.Parse(comboBocCategory.SelectedValue.ToString()),
                        ProductType      = textBoxProductType.Text,
                        ProductBrand     = textBoxBrand.Text,
                        ProductSize      = textBoxSize.Text,
                        ProductColor     = textBoxColour.Text,
                        CreatedByUser_ID = ModelClass._UserID, //UserID_Static
                        BarCode          = textBoxBarcode.Text
                    };

                    string Photo = ImageClass.GetBase64StringFromImage(Imager.Resize(pictureBoxProduct.Image, 200, 200, true)); //Resize & Convert to String
                    mp.ProductPicture = Photo;

                    MainClass.POS.CRUDProductCreate(mp, out Status, out StatusDetails);
                    if (Status)
                    {
                        JIMessageBox.InformationMessage(StatusDetails);
                    }
                    else
                    {
                        MessageBox.Show(StatusDetails, "Warning", MessageBoxButtons.OK, MessageBoxIcon.Warning);
                    }
                    gridViewProduct.Rows.Clear();
                }
                else
                {
                    MessageBox.Show("Please Fill All Fields", "Information", MessageBoxButtons.OK, MessageBoxIcon.Information);
                }
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message);
            }
        }
示例#30
0
 private void buttonUpdateSupplier_Click(object sender, EventArgs e)
 {
     try
     {
         if (textBoxName.Text == "" ||
             textBoxPhone.Text == "" ||
             textBoxMobile.Text == "" ||
             textBoxAddress.Text == ""
             )
         {
             JIMessageBox.ExclamationMessage("Please Fill All Fields !"); return;
         }
         updateSupplier();
     }
     catch (Exception ex)
     {
         JIMessageBox.ErrorMessage(ex.Message);
     }
 }