Exemplo n.º 1
0
        private Image GetProductPhoto(int SubProductID)
        {
            Image imgProduct = null;

            ObjDAL.SetStoreProcedureData("SubProductID", SqlDbType.Int, SubProductID, clsConnection_DAL.ParamType.Input);
            ObjDAL.SetStoreProcedureData("ProductID", SqlDbType.Int, 0, clsConnection_DAL.ParamType.Input);
            DataSet ds = ObjDAL.ExecuteStoreProcedure_Get(clsUtility.DBName + ".dbo.SPR_Get_ProductPhoto");

            if (ds != null && ds.Tables.Count > 0)
            {
                DataTable dt = ds.Tables[0];
                if (ObjUtil.ValidateTable(dt))
                {
                    if (Convert.ToInt32(dt.Rows[0]["Flag"]) == 1)
                    {
                        string img = dt.Rows[0]["ImgName"].ToString();
                        if (System.IO.File.Exists(img))
                        {
                            imgProduct = Image.FromFile(img);
                        }
                        else
                        {
                            imgProduct = IMS_Client_2.Properties.Resources.NoImage;
                        }
                    }
                    else
                    {
                        imgProduct = IMS_Client_2.Properties.Resources.NoImage;
                        //clsUtility.ShowInfoMessage("Image file for the selected product doesn't exist.", clsUtility.strProjectTitle);
                    }
                }
            }
            return(imgProduct);
        }
Exemplo n.º 2
0
        private void GetSelectedItemStockDetails()
        {
            ObjDAL.SetStoreProcedureData("ProductID", SqlDbType.Int, dgvBranchStockDetails.SelectedRows[0].Cells["ProductID"].Value, clsConnection_DAL.ParamType.Input);
            ObjDAL.SetStoreProcedureData("BarcodeNo", SqlDbType.BigInt, dgvBranchStockDetails.SelectedRows[0].Cells["BarcodeNo"].Value, clsConnection_DAL.ParamType.Input);
            ObjDAL.SetStoreProcedureData("ColorID", SqlDbType.Int, 0, clsConnection_DAL.ParamType.Input);
            ObjDAL.SetStoreProcedureData("ModelNo", SqlDbType.NVarChar, dgvBranchStockDetails.SelectedRows[0].Cells["ModelNo"].Value, clsConnection_DAL.ParamType.Input);
            ObjDAL.SetStoreProcedureData("CategoryID", SqlDbType.Int, 0, clsConnection_DAL.ParamType.Input);
            DataSet ds = ObjDAL.ExecuteStoreProcedure_Get(clsUtility.DBName + ".dbo.SPR_Get_Material_NewDetails");

            if (ds != null && ds.Tables.Count > 0)
            {
                DataTable dt = ds.Tables[0];
                if (ObjUtil.ValidateTable(dt))
                {
                    if (dt.Rows.Count > 1)
                    {
                        dgvStockDetails.DataSource = dt;
                    }
                    else
                    {
                        dgvStockDetails.DataSource = null;
                    }
                }
                else
                {
                    dgvStockDetails.DataSource = null;
                }
            }
            ObjDAL.ResetData();
        }
        private void LoadData()
        {
            ObjDAL.SetStoreProcedureData("StoreID", SqlDbType.Int, frmHome.Home_StoreID, clsConnection_DAL.ParamType.Input);
            ObjDAL.SetStoreProcedureData("FromDate", SqlDbType.Date, DBNull.Value, clsConnection_DAL.ParamType.Input);
            ObjDAL.SetStoreProcedureData("ToDate", SqlDbType.Date, DBNull.Value, clsConnection_DAL.ParamType.Input);
            DataSet ds = ObjDAL.ExecuteStoreProcedure_Get(clsUtility.DBName + ".dbo.SPR_Get_PettyCashExpAmt");

            if (ds != null && ds.Tables.Count > 0)
            {
                DataTable dt = ds.Tables[0];
                if (ds.Tables.Count > 1)
                {
                    DataTable dtPettyCashBal = ds.Tables[1];
                    if (ObjUtil.ValidateTable(dtPettyCashBal))
                    {
                        txtTotalPettyCash.Text = dtPettyCashBal.Rows[0]["TotalPettyCashAmt"].ToString();
                        txtTotalExpenses.Text  = dtPettyCashBal.Rows[0]["TotalPettyCashExpAmt"].ToString();
                        txtPettyCashBAL.Text   = dtPettyCashBal.Rows[0]["PettyCashBalance"].ToString();
                    }
                }
                if (ObjUtil.ValidateTable(dt))
                {
                    dgvPettyCashExp.DataSource = dt;
                }
                else
                {
                    dgvPettyCashExp.DataSource = null;
                }
            }
        }
        private void SearchByStyleNo()
        {
            ObjDAL.SetStoreProcedureData("PurchaseInvoiceID", SqlDbType.Int, txtPurchaseID.Text, clsConnection_DAL.ParamType.Input);
            ObjDAL.SetStoreProcedureData("StoreID", SqlDbType.Int, frmHome.Home_StoreID, clsConnection_DAL.ParamType.Input);
            ObjDAL.SetStoreProcedureData("ModelNo", SqlDbType.NVarChar, cmbListBox.Text, clsConnection_DAL.ParamType.Input);
            ObjDAL.SetStoreProcedureData("PrintStaus", SqlDbType.Int, 0, clsConnection_DAL.ParamType.Input);
            DataSet ds = ObjDAL.ExecuteStoreProcedure_Get(clsUtility.DBName + ".dbo.Get_PurchaseInvoice_BulkPrint_Color_Size");

            if (ObjUtil.ValidateDataSet(ds))
            {
                DataTable dtPurchaseInvDetails = ds.Tables[0];
                if (ObjUtil.ValidateTable(dtPurchaseInvDetails))
                {
                    dataGridView1.DataSource = dtPurchaseInvDetails;
                    //txtPurchaseID.Text = "";
                }
                else
                {
                    dataGridView1.DataSource = dtPurchaseInvDetails;
                    //txtPurchaseID.Clear();
                    clsUtility.ShowInfoMessage("No purchase invoice found for the given purhcase number.");
                }
            }
            ObjDAL.ResetData();
        }
Exemplo n.º 5
0
        private void LoadData()
        {
            //DataTable dtPurchaseInvDetails = ObjCon.ExecuteSelectStatement("EXEC " + clsUtility.DBName + ".dbo.Get_PurchaseInvoice_BulkPrint_Color_Size '" + txtPurchaseID.Text + "'");
            ObjDAL.SetStoreProcedureData("PurchaseInvoiceID", SqlDbType.Int, txtPurchaseID.Text, clsConnection_DAL.ParamType.Input);
            ObjDAL.SetStoreProcedureData("StoreID", SqlDbType.Int, frmHome.Home_StoreID, clsConnection_DAL.ParamType.Input);
            ObjDAL.SetStoreProcedureData("ModelNo", SqlDbType.NVarChar, "0", clsConnection_DAL.ParamType.Input);
            ObjDAL.SetStoreProcedureData("PrintStaus", SqlDbType.Int, 0, clsConnection_DAL.ParamType.Input);
            DataSet ds = ObjDAL.ExecuteStoreProcedure_Get(clsUtility.DBName + ".dbo.Get_PurchaseInvoice_BulkPrint_Color_Size");

            if (ObjUtil.ValidateDataSet(ds))
            {
                btnResetPrint.Enabled = true;
                DataTable dtPurchaseInvDetails = ds.Tables[0];
                if (ObjUtil.ValidateTable(dtPurchaseInvDetails))
                {
                    dgvProductDetails.DataSource = dtPurchaseInvDetails;
                    CurrentPurchaseInvoiceID     = txtPurchaseID.Text;
                    //txtPurchaseID.Text = "";
                }
                else
                {
                    dgvProductDetails.DataSource = dtPurchaseInvDetails;
                    chkAll.Visible           = false;
                    CurrentPurchaseInvoiceID = "";
                    //txtPurchaseID.Clear();
                    clsUtility.ShowInfoMessage("No purchase invoice found for the given purhcase number.", clsUtility.strProjectTitle);
                    cmbListBox.DataSource = null;
                }
                if (ds.Tables.Count >= 1)
                {
                    DataTable dtStyleNo = ds.Tables[1];
                    if (ObjUtil.ValidateTable(dtStyleNo))
                    {
                        cmbListBox.DataSource    = dtStyleNo;
                        cmbListBox.DisplayMember = "ModelNo";
                        cmbListBox.ValueMember   = "ModelNo";
                        cmbListBox.SelectedIndex = -1;
                    }
                }
                if (ds.Tables.Count >= 2)
                {
                    DataTable dtProductPrint = ds.Tables[2];
                    if (ObjUtil.ValidateTable(dtProductPrint))
                    {
                        dataGridView1.DataSource = dtProductPrint;
                    }
                    else
                    {
                        dataGridView1.DataSource = null;
                    }
                }
            }
            else
            {
                btnResetPrint.Enabled = false;
            }
            chkAll.Visible = true;
        }
Exemplo n.º 6
0
        private void LoadData()
        {
            ObjDAL.SetStoreProcedureData("StoreBillDetailsID", SqlDbType.Int, pStoreBillDetailsID, clsConnection_DAL.ParamType.Input);
            DataSet ds = ObjDAL.ExecuteStoreProcedure_Get(clsUtility.DBName + ".dbo.SPR_Get_StoreTransfer_ListItems");

            //DataSet ds = ObjDAL.ExecuteStoreProcedure_Get(clsUtility.DBName + ".dbo.SPR_Get_StoreTransfer_ItemDetails");
            if (ds != null && ds.Tables.Count > 0)
            {
                DataTable dt = ds.Tables[0];
                if (ObjUtil.ValidateTable(dt))
                {
                    dgvTransferWatch.DataSource = dt;
                    txtBillNo.Text    = dt.Rows[0]["BillNo"].ToString();
                    txtStoreName.Text = dt.Rows[0]["StoreName"].ToString();

                    txtBillDate.Text        = Convert.ToDateTime(dt.Rows[0]["BillDate"]).ToString("yyyy-MM-dd");
                    txtReceiveBillDate.Text = dt.Rows[0]["ReceiveBillDate"] != DBNull.Value ?
                                              Convert.ToDateTime(dt.Rows[0]["ReceiveBillDate"]).ToString("yyyy-MM-dd") : "";

                    txtTotalBillQTY.Text  = dt.Rows[0]["TotalQTY"].ToString();
                    txtTotalEnterQTY.Text = dt.Rows[0]["ReceivedTotalQTY"].ToString();
                }
                else
                {
                    dgvTransferWatch.DataSource = null;
                }
            }
        }
Exemplo n.º 7
0
        private void btnViewDetails_Click(object sender, EventArgs e)
        {
            if (ObjUtil.IsControlTextEmpty(txtSupplierBillNo))
            {
                clsUtility.ShowInfoMessage("Please Enter Bill Number.", clsUtility.strProjectTitle);
                txtSupplierBillNo.Focus();
                return;
            }
            dgvPurchaseItem.RowHeadersWidthSizeMode = DataGridViewRowHeadersWidthSizeMode.EnableResizing;
            //Most time consumption enum is DataGridViewRowHeadersWidthSizeMode.AutoSizeToAllHeaders
            dgvPurchaseItem.RowHeadersVisible = false; // set it to false if not needed

            ObjDAL.SetStoreProcedureData("BillNo", SqlDbType.NVarChar, txtPurchaseInvoiceID.Text, clsConnection_DAL.ParamType.Input);
            DataSet ds = ObjDAL.ExecuteStoreProcedure_Get("sp_DetailPurchaseInvoiceReport");

            if (ObjUtil.ValidateDataSet(ds))
            {
                dgvPurchaseInvoice.DataSource = ds.Tables[0];
                if (ds.Tables.Count > 1)
                {
                    dgvPurchaseInvoiceDetail.DataSource = ds.Tables[1];
                }
                if (ds.Tables.Count > 2)
                {
                    dgvPurchaseItem.DataSource = ds.Tables[2];
                }
                dgvPurchaseInvoice.ClearSelection();
                dgvPurchaseInvoiceDetail.ClearSelection();
                dgvPurchaseItem.ClearSelection();
            }
        }
Exemplo n.º 8
0
        private void LoadData()
        {
            ObjDAL.SetStoreProcedureData("StoreID", SqlDbType.Int, frmHome.Home_StoreID, clsConnection_DAL.ParamType.Input);
            DataSet ds = ObjDAL.ExecuteStoreProcedure_Get(clsUtility.DBName + ".dbo.SPR_Get_ReceiveBranch_Transfer_List");

            if (ds != null && ds.Tables.Count > 0)
            {
                DataTable dt = ds.Tables[0];
                if (ObjUtil.ValidateTable(dt))
                {
                    dgvProductDetails.DataSource = dt;
                }
                else
                {
                    dgvProductDetails.DataSource = null;
                }
            }
        }
Exemplo n.º 9
0
        private void LoadData()
        {
            ObjDAL.SetStoreProcedureData("StoreID", SqlDbType.Int, frmHome.Home_StoreID, clsConnection_DAL.ParamType.Input);
            DataSet ds = ObjDAL.ExecuteStoreProcedure_Get(clsUtility.DBName + ".dbo.SPR_Get_PettyCashAmt");

            if (ds != null && ds.Tables.Count > 0)
            {
                DataTable dt = ds.Tables[0];
                if (ObjUtil.ValidateTable(dt))
                {
                    dataGridView1.DataSource = dt;
                }
                else
                {
                    dataGridView1.DataSource = null;
                }
            }
        }
Exemplo n.º 10
0
        private void txtSearchByProduct_TextChanged(object sender, EventArgs e)
        {
            if (txtSearchByProduct.Text.Trim().Length == 0)
            {
                LoadData();
                return;
            }
            ObjDAL.SetStoreProcedureData("ProductName", SqlDbType.NVarChar, txtSearchByProduct.Text.Trim(), clsConnection_DAL.ParamType.Input);
            ObjDAL.SetStoreProcedureData("CategoryId", SqlDbType.Int, 0, clsConnection_DAL.ParamType.Input);
            DataSet ds = ObjDAL.ExecuteStoreProcedure_Get(clsUtility.DBName + ".dbo.Get_Product_Master");

            if (ds != null && ds.Tables.Count > 0)
            {
                DataTable dt = ds.Tables[0];
                if (ObjUtil.ValidateTable(dt))
                {
                    dataGridView1.DataSource = dt;
                }
                else
                {
                    dataGridView1.DataSource = null;
                }
            }
            else
            {
                dataGridView1.DataSource = null;
            }
        }
Exemplo n.º 11
0
        private void LoadData()
        {
            ObjDAL.SetStoreProcedureData("ColorName", SqlDbType.NVarChar, 0, clsConnection_DAL.ParamType.Input);
            DataSet ds = ObjDAL.ExecuteStoreProcedure_Get(clsUtility.DBName + ".dbo.SPR_Get_Color_Master");

            if (ds != null && ds.Tables.Count > 0)
            {
                DataTable dt = ds.Tables[0];
                if (ObjUtil.ValidateTable(dt))
                {
                    dgvColorMaster.DataSource = dt;
                }
                else
                {
                    dgvColorMaster.DataSource = null;
                }
            }
            else
            {
                dgvColorMaster.DataSource = null;
            }
            ObjDAL.ResetData();
        }
Exemplo n.º 12
0
        private void GetDefaultShop()
        {
            ObjDAL.SetStoreProcedureData("MachineName", SqlDbType.NChar, Environment.MachineName, clsConnection_DAL.ParamType.Input);
            DataSet ds = ObjDAL.ExecuteStoreProcedure_Get(clsUtility.DBName + ".[dbo].SPR_GetDefaultShopName");

            if (ds != null && ds.Tables.Count > 0)
            {
                DataTable dt = ds.Tables[0];
                if (ObjUtil.ValidateTable(dt))
                {
                    Home_StoreID     = Convert.ToInt32(dt.Rows[0]["StoreID"]);
                    lblShopName.Text = "Shop Name : " + dt.Rows[0]["StoreName"];
                }
                else
                {
                    lblShopName.Text = "Shop Name : " + "NA";
                }
            }
        }
Exemplo n.º 13
0
        private void LoadData()
        {
            ObjDAL.SetStoreProcedureData("SupplierBillNo", SqlDbType.VarChar, '0', clsConnection_DAL.ParamType.Input);
            ObjDAL.SetStoreProcedureData("ShipmentNo", SqlDbType.VarChar, '0', clsConnection_DAL.ParamType.Input);
            DataSet ds = ObjDAL.ExecuteStoreProcedure_Get(clsUtility.DBName + ".dbo.SPR_Get_PurchaseInvoice");

            if (ds != null && ds.Tables.Count > 0)
            {
                DataTable dt = ds.Tables[0];
                if (ObjUtil.ValidateTable(dt))
                {
                    dataGridView1.DataSource = dt;
                }
                else
                {
                    dataGridView1.DataSource = null;
                }
            }
            else
            {
                dataGridView1.DataSource = null;
            }
        }
Exemplo n.º 14
0
        private void btnPost_Click(object sender, EventArgs e)
        {
            if (clsFormRights.HasFormRight(clsFormRights.Forms.Posting_Delivery, clsFormRights.Operation.Save) || clsUtility.IsAdmin)
            {
                if (validateform())
                {
                    bool b = clsUtility.ShowQuestionMessage("Are you sure want to post for " + txtSupplierBillNo.Text + " ?", clsUtility.strProjectTitle);
                    if (b)
                    {
                        ObjDAL.SetStoreProcedureData("PurchaseInvoiceID", SqlDbType.Int, txtPurchaseInvoiceID.Text, clsConnection_DAL.ParamType.Input);
                        ObjDAL.SetStoreProcedureData("StoreID", SqlDbType.Int, cmbStore.SelectedValue, clsConnection_DAL.ParamType.Input);
                        ObjDAL.SetStoreProcedureData("TotalQTY", SqlDbType.Int, txtTotalQTY.Text, clsConnection_DAL.ParamType.Input);
                        ObjDAL.SetStoreProcedureData("EntryType", SqlDbType.Int, cmbEntryType.SelectedIndex, clsConnection_DAL.ParamType.Input);
                        ObjDAL.SetStoreProcedureData("SupplierBillNo", SqlDbType.VarChar, txtSupplierBillNo.Text, clsConnection_DAL.ParamType.Input);
                        ObjDAL.SetStoreProcedureData("CreatedBy", SqlDbType.Int, clsUtility.LoginID, clsConnection_DAL.ParamType.Input);
                        DataSet ds = ObjDAL.ExecuteStoreProcedure_Get(clsUtility.DBName + ".dbo.Insert_PurchaseInvoice_BulkPrint_Color_Size");
                        if (ds != null && ds.Tables.Count > 0)
                        {
                            DataTable dt = ds.Tables[0];
                            if (ObjUtil.ValidateTable(dt))
                            {
                                int    flag = Convert.ToInt32(dt.Rows[0]["Flag"]);
                                string Msg  = dt.Rows[0]["Msg"].ToString();

                                clsUtility.ShowInfoMessage(Msg, clsUtility.strProjectTitle);
                                ClearAll();
                            }
                            else
                            {
                                clsUtility.ShowInfoMessage("Posting Delivery Entry for '" + txtSupplierBillNo.Text + "' is not Saved Successfully..", clsUtility.strProjectTitle);
                            }
                        }
                    }
                }
            }
            else
            {
                clsUtility.ShowInfoMessage("You have no rights to perform this task", clsUtility.strProjectTitle);
            }
        }
Exemplo n.º 15
0
        private void SaveEmployee()
        {
            ObjDAL.SetStoreProcedureData("EmployeeCode", SqlDbType.NVarChar, txtEmployeeCode.Text.Trim(), clsConnection_DAL.ParamType.Input);
            ObjDAL.SetStoreProcedureData("Name", SqlDbType.NVarChar, txtName.Text.Trim(), clsConnection_DAL.ParamType.Input);
            ObjDAL.SetStoreProcedureData("MobileNo", SqlDbType.VarChar, txtMobileNo.Text, clsConnection_DAL.ParamType.Input);

            if (radMale.Checked)
            {
                ObjDAL.SetStoreProcedureData("Gender", SqlDbType.Bit, true, clsConnection_DAL.ParamType.Input);
            }
            else if (radFemale.Checked)
            {
                ObjDAL.SetStoreProcedureData("Gender", SqlDbType.Bit, false, clsConnection_DAL.ParamType.Input);
            }
            if (dtpDOB.Checked)
            {
                ObjDAL.SetStoreProcedureData("DOB", SqlDbType.DateTime, dtpDOB.Value.ToString("yyyy-MM-dd"), clsConnection_DAL.ParamType.Input);
            }
            else
            {
                ObjDAL.SetStoreProcedureData("DOB", SqlDbType.DateTime, null, clsConnection_DAL.ParamType.Input);
            }
            ObjDAL.SetStoreProcedureData("Address", SqlDbType.NVarChar, txtAdd.Text.Trim(), clsConnection_DAL.ParamType.Input);

            if (PicEmployee.Image != null)
            {
                ObjDAL.SetStoreProcedureData("Photo", SqlDbType.VarBinary, ObjUtil.GetImageBytes(PicEmployee.Image), clsConnection_DAL.ParamType.Input);
            }
            ObjDAL.SetStoreProcedureData("CreatedBy", SqlDbType.Int, clsUtility.LoginID, clsConnection_DAL.ParamType.Input);
            ObjDAL.SetStoreProcedureData("EMPID", SqlDbType.Int, 0, clsConnection_DAL.ParamType.Output);

            bool b = ObjDAL.ExecuteStoreProcedure_DML(clsUtility.DBName + ".dbo.SPR_Insert_Employee");

            if (b)
            {
                DataTable dt = ObjDAL.GetOutputParmData();
                if (ObjUtil.ValidateTable(dt))
                {
                    EmployeeID = Convert.ToInt32(dt.Rows[0][1]);
                }
                ObjUtil.SetCommandButtonStatus(clsCommon.ButtonStatus.AfterSave);
                clsUtility.ShowInfoMessage("Employee has been added Successfully.", clsUtility.strProjectTitle);

                if (txtUsername.Text.Trim().Length != 0 && txtPass.Text.Trim().Length != 0)
                {
                    CreateNewUser(EmployeeID);
                }
                ClearAll();
                LoadData();
                grpEmployee.Enabled = false;
            }
            else
            {
                clsUtility.ShowInfoMessage("Failed to add the Employee.", clsUtility.strProjectTitle);
                ObjDAL.ResetData();
            }
        }
 private void btnSave_Click(object sender, EventArgs e)
 {
     if (clsFormRights.HasFormRight(clsFormRights.Forms.Delivering_Purchase_Bill, clsFormRights.Operation.Save) || clsUtility.IsAdmin)
     {
         if (Validateform())
         {
             if (DuplicateUser(0))
             {
                 int DeliveryPurchaseBillID = 0;
                 ObjDAL.SetColumnData("PurchaseInvoiceID", SqlDbType.Int, pPurchaseInvoiceID);
                 ObjDAL.SetColumnData("SupplierBillNo", SqlDbType.NVarChar, txtSupplierBillNo.Text.Trim());
                 ObjDAL.SetColumnData("SizeTypeID", SqlDbType.Int, cmbSizeType.SelectedValue);
                 ObjDAL.SetColumnData("ModelNo", SqlDbType.NVarChar, cmbListBox.Text);
                 //ObjDAL.SetColumnData("ModelNo", SqlDbType.NVarChar, listBoxStyleNo.SelectedItem);
                 ObjDAL.SetColumnData("ProductID", SqlDbType.Int, ProductID);
                 ObjDAL.SetColumnData("SubProductID", SqlDbType.Int, SubProductID);
                 ObjDAL.SetColumnData("StoreID", SqlDbType.Int, cmbStore.SelectedValue);
                 ObjDAL.SetColumnData("CreatedBy", SqlDbType.Int, clsUtility.LoginID); //if LoginID=0 then Test Admin else user
                 DeliveryPurchaseBillID = ObjDAL.InsertData(clsUtility.DBName + ".dbo.DeliveryPurchaseBill1", true);
                 if (DeliveryPurchaseBillID > 0)
                 {
                     int DeliveryPurchaseBillID2 = DataSavedDeliveryPurchaseBill2(DeliveryPurchaseBillID);
                     int DeliveryPurchaseBillID3 = DataSavedDeliveryPurchaseBill3(DeliveryPurchaseBillID, DeliveryPurchaseBillID2);
                     if (DeliveryPurchaseBillID2 > 0 && DeliveryPurchaseBillID3 > 0)
                     {
                         ObjUtil.SetCommandButtonStatus(clsCommon.ButtonStatus.AfterSave);
                         clsUtility.ShowInfoMessage(clsUtility.MsgDataSaved, clsUtility.strProjectTitle);
                     }
                     else
                     {
                         ObjDAL.SetStoreProcedureData("PurchaseInvoiceID", SqlDbType.Int, pPurchaseInvoiceID, clsConnection_DAL.ParamType.Input);
                         ObjDAL.ExecuteStoreProcedure_DML(clsUtility.DBName + ".dbo.SPR_Delete_Delivering_PurchaseBill");
                         clsUtility.ShowInfoMessage(clsUtility.MsgDatanotSaved, clsUtility.strProjectTitle);
                     }
                     LoadData(); // Added
                     LoadModelData();
                     Clear_ColorSize();
                     txtSupplierBillNo.Enabled = false;
                     btnSearch.Enabled         = false;
                     object qty = dtPurchaseInvoice.Compute("SUM(QTY)", null);
                     txtTotalQTY.Text = qty.ToString();
                     //grpPurchaseBillDetail.Enabled = false;
                 }
                 else
                 {
                     clsUtility.ShowInfoMessage(clsUtility.MsgDatanotSaved, clsUtility.strProjectTitle);
                 }
                 ObjDAL.ResetData();
             }
             else
             {
                 clsUtility.ShowErrorMessage("Purchase Invoice '" + txtSupplierBillNo.Text + "' is already exist..", clsUtility.strProjectTitle);
                 txtSupplierBillNo.Focus();
             }
         }
     }
     else
     {
         clsUtility.ShowInfoMessage("You have no rights to perform this task", clsUtility.strProjectTitle);
     }
 }
Exemplo n.º 17
0
        private void SearchByProductID()
        {
            //DataTable dt = ObjDAL.ExecuteSelectStatement("EXEC " + clsUtility.DBName + ".dbo.Get_Material_Details " + txtProductID.Text + ",NULL");

            ObjDAL.SetStoreProcedureData("ProductID", SqlDbType.Int, txtProductID.Text.Trim(), clsConnection_DAL.ParamType.Input);
            ObjDAL.SetStoreProcedureData("StoreID", SqlDbType.Int, DBNull.Value, clsConnection_DAL.ParamType.Input);
            ObjDAL.SetStoreProcedureData("BarcodeNo", SqlDbType.BigInt, DBNull.Value, clsConnection_DAL.ParamType.Input);
            ObjDAL.SetStoreProcedureData("ColorID", SqlDbType.Int, DBNull.Value, clsConnection_DAL.ParamType.Input);
            ObjDAL.SetStoreProcedureData("ModelNo", SqlDbType.NVarChar, DBNull.Value, clsConnection_DAL.ParamType.Input);
            DataSet   ds = ObjDAL.ExecuteStoreProcedure_Get(clsUtility.DBName + ".dbo.Get_Material_Details");
            DataTable dt = ds.Tables[0];

            if (ObjUtil.ValidateTable(dt))
            {
                dgvProductDetails.DataSource = dt;
            }
            else
            {
                dgvProductDetails.DataSource = null;
            }
            ObjDAL.ResetData();
        }
Exemplo n.º 18
0
        private void LoadData()
        {
            try
            {
                ObjDAL.SetStoreProcedureData("MasterCashClosingID", SqlDbType.Int, pMasterCashClosingID, clsConnection_DAL.ParamType.Input);
                ObjDAL.SetStoreProcedureData("StoreID", SqlDbType.Int, frmHome.Home_StoreID, clsConnection_DAL.ParamType.Input);
                ObjDAL.SetStoreProcedureData("PettyCashBAL", SqlDbType.Decimal, lblPettyCashBAL.Text, clsConnection_DAL.ParamType.Output);
                DataSet ds = ObjDAL.ExecuteStoreProcedure_Get(clsUtility.DBName + ".dbo.SPR_Get_CashClosing_Details");
                if (ds != null && ds.Tables.Count > 0)
                {
                    DataTable dt = ds.Tables[0];
                    dtCredit   = ds.Tables[1];
                    dtExpenses = ds.Tables[2];

                    DataTable dtoutput = ObjDAL.GetOutputParmData();
                    if (ObjUtil.ValidateTable(dtoutput))
                    {
                        PettyCashBAL         = Convert.ToDecimal(dtoutput.Rows[0][1]);
                        lblPettyCashBAL.Text = PettyCashBAL.ToString();
                    }

                    if (ObjUtil.ValidateTable(dt))
                    {
                        dgvCloseCash.DataSource = dt;
                        dtCash = dt;
                        if (Convert.ToInt32(dt.Rows[0]["CashStatus"]) == 0)
                        {
                            dgvCloseCash.ReadOnly = false;
                            btnOpenCash.Enabled   = false;
                            btnCloseCash.Enabled  = true;
                            btnPreview.Enabled    = false;
                            btnPrint.Enabled      = false;

                            //btnPreview.Enabled = true;
                            //btnPrint.Enabled = true;
                            dgvCloseCash.DataSource = dtCash;
                        }
                        else
                        {
                            if (DateTime.Now.ToString("yyyy-MM-dd") == Convert.ToDateTime(dt.Rows[0]["CashBoxDate"]).ToString("yyyy-MM-dd"))
                            {
                                dgvCloseCash.ReadOnly = true;
                                btnOpenCash.Enabled   = false;
                                btnCloseCash.Enabled  = false;
                                btnPreview.Enabled    = true;
                                btnPrint.Enabled      = true;
                            }
                            else
                            {
                                dgvCloseCash.ReadOnly = true;
                                btnOpenCash.Enabled   = true;
                                btnCloseCash.Enabled  = false;
                                btnPreview.Enabled    = true;
                                btnPrint.Enabled      = true;

                                //btnPreview.Enabled = false;
                                //btnPrint.Enabled = false;
                            }
                        }
                        txtCashNo.Text         = dt.Rows[0]["CashNo"].ToString();
                        txtCashierName.Text    = dt.Rows[0]["Name"].ToString();
                        cmbShop.SelectedValue  = dt.Rows[0]["StoreID"];
                        lblReturnedAmount.Text = dt.Rows[0]["CashReturn"].ToString();
                        txtTotalValue.Text     = dt.Rows[0]["TotalCashValue"].ToString();
                    }
                    else
                    {
                        dgvCloseCash.DataSource = null;
                        dtCash               = null;
                        dtExpenses           = null;
                        btnOpenCash.Enabled  = true;
                        btnCloseCash.Enabled = false;
                        btnPreview.Enabled   = false;
                        btnPrint.Enabled     = false;
                    }
                    ObjDAL.ResetData();
                }
                else
                {
                    dtCash     = null;
                    dtExpenses = null;
                    dgvCloseCash.DataSource = null;
                    //btnOpenCash.Enabled = false;
                    btnOpenCash.Enabled  = true;
                    btnCloseCash.Enabled = false;
                    btnPreview.Enabled   = false;
                    btnPrint.Enabled     = false;
                }
            }
            catch (Exception ex)
            {
                clsUtility.ShowErrorMessage(ex.ToString(), clsUtility.strProjectTitle);
            }
        }
Exemplo n.º 19
0
        private void LoadData()
        {
            ObjDAL.SetStoreProcedureData("StoreBillDetailsID", SqlDbType.Int, StoreBillDetailsID, clsConnection_DAL.ParamType.Input);
            DataSet ds = ObjDAL.ExecuteStoreProcedure_Get(clsUtility.DBName + ".dbo.SPR_Get_StoreTransfer_ItemDetails");

            if (ds != null && ds.Tables.Count > 0)
            {
                dtStoreTransfer = ds.Tables[0];
                if (ObjUtil.ValidateTable(dtStoreTransfer))
                {
                    dgvProductDetails.DataSource = dtStoreTransfer;
                    txtDate.Text     = Convert.ToDateTime(dtStoreTransfer.Rows[0]["BillDate"]).ToShortDateString();
                    txtTotalQTY.Text = dtStoreTransfer.Rows[0]["TotalQTY"].ToString();
                    txtBillNo.Text   = dtStoreTransfer.Rows[0]["BillNo"].ToString();

                    object rate = dtStoreTransfer.Compute("SUM(Total)", string.Empty);
                    txtValue.Text = rate.ToString();
                }
                else
                {
                    dgvProductDetails.DataSource = null;
                }
            }
            else
            {
                dgvProductDetails.DataSource = null;
            }
        }
Exemplo n.º 20
0
        private void LoadItemModelDetails()
        {
            ObjDAL.SetStoreProcedureData("ProductID", SqlDbType.Int, 0, clsConnection_DAL.ParamType.Input);
            ObjDAL.SetStoreProcedureData("ModelNo", SqlDbType.NVarChar, '0', clsConnection_DAL.ParamType.Input);
            ObjDAL.SetStoreProcedureData("StoreID", SqlDbType.Int, 0, clsConnection_DAL.ParamType.Input);
            DataSet ds = ObjDAL.ExecuteStoreProcedure_Get(clsUtility.DBName + ".dbo.SPR_Get_ItemWiseModelNo");

            if (ds != null && ds.Tables.Count > 0)
            {
                DataTable dtItemModel = ds.Tables[0];
                if (ObjUtil.ValidateTable(dtItemModel))
                {
                    dgvProductDetails.DataSource = dtItemModel;
                }
                else
                {
                    dgvProductDetails.DataSource = null;
                }
            }
            else
            {
                dgvProductDetails.DataSource = null;
            }
        }
Exemplo n.º 21
0
 private void LoadData()
 {
     try
     {
         ObjDAL.SetStoreProcedureData("FromDate", SqlDbType.Date, DBNull.Value, clsConnection_DAL.ParamType.Input);
         ObjDAL.SetStoreProcedureData("ToDate", SqlDbType.Date, DBNull.Value, clsConnection_DAL.ParamType.Input);
         ObjDAL.SetStoreProcedureData("BillStatus", SqlDbType.Int, DBNull.Value, clsConnection_DAL.ParamType.Input);
         DataSet ds = ObjDAL.ExecuteStoreProcedure_Get(clsUtility.DBName + ".dbo.SPR_Get_StoreTransfer_List");
         if (ds != null && ds.Tables.Count > 0)
         {
             DataTable dt = ds.Tables[0];
             if (ObjUtil.ValidateTable(dt))
             {
                 dgvTransferWatch.DataSource = dt;
             }
             else
             {
                 dgvTransferWatch.DataSource = null;
             }
         }
     }
     catch (Exception ex)
     {
         clsUtility.ShowErrorMessage(ex.ToString(), clsUtility.strProjectTitle);
     }
 }
Exemplo n.º 22
0
        private void btnSave_Click(object sender, EventArgs e)
        {
            if (clsFormRights.HasFormRight(clsFormRights.Forms.Customer_Master, clsFormRights.Operation.Save) || clsUtility.IsAdmin)
            {
                if (ValidateForm())
                {
                    if (DuplicateUser(0))
                    {
                        ObjDAL.SetStoreProcedureData("Name", SqlDbType.NVarChar, txtCustomerName.Text.Trim(), clsConnection_DAL.ParamType.Input);
                        ObjDAL.SetStoreProcedureData("Address", SqlDbType.NVarChar, txtCustomerAddress.Text.Trim(), clsConnection_DAL.ParamType.Input);
                        ObjDAL.SetStoreProcedureData("PhoneNo", SqlDbType.NVarChar, txtCustomerMobileNo.Text.Trim(), clsConnection_DAL.ParamType.Input);
                        ObjDAL.SetStoreProcedureData("EmailID", SqlDbType.NVarChar, txtCustomerEmailID.Text.Trim(), clsConnection_DAL.ParamType.Input);
                        ObjDAL.SetStoreProcedureData("ActiveStatus", SqlDbType.Bit, cmbCustomerActiveStatus.SelectedItem.ToString() == "Active" ? 1 : 0, clsConnection_DAL.ParamType.Input);
                        ObjDAL.SetStoreProcedureData("CreatedBy", SqlDbType.Int, clsUtility.LoginID, clsConnection_DAL.ParamType.Input);

                        bool b = ObjDAL.ExecuteStoreProcedure_DML(clsUtility.DBName + ".dbo.SPR_Insert_Customer");
                        if (b)
                        {
                            //ObjUtil.SetCommandButtonStatus(clsCommon.ButtonStatus.AfterSave, clsUtility.IsAdmin);
                            ObjUtil.SetCommandButtonStatus(clsCommon.ButtonStatus.AfterSave);
                            clsUtility.ShowInfoMessage("Customer Name : '" + txtCustomerName.Text + "' is Saved Successfully..", clsUtility.strProjectTitle);
                            ClearAll();
                            LoadData();
                            grpCustomer.Enabled = false;
                        }
                        else
                        {
                            clsUtility.ShowInfoMessage("Customer Name : '" + txtCustomerName.Text + "' is not Saved Successfully..", clsUtility.strProjectTitle);
                        }
                    }
                    else
                    {
                        clsUtility.ShowErrorMessage("'" + txtCustomerName.Text + "' Customer is already exist..", clsUtility.strProjectTitle);
                        txtCustomerName.Focus();
                    }
                    ObjDAL.ResetData();
                }
            }
            else
            {
                clsUtility.ShowInfoMessage("You have no rights to perform this task", clsUtility.strProjectTitle);
            }
        }