Exemple #1
0
        void BindSalesOrder()
        {
            oblSalesOrder = new Store.SalesOrder.BusinessLogic.SalesOrder();


            try
            {
                objSalesList = oblSalesOrder.GetAllSalesOrderList(0, 0, "");

                if (objSalesList != null)
                {
                    gvSOrder.DataSource = objSalesList;
                    gvSOrder.DataBind();
                }
                else
                {
                    gvSOrder.DataSource = null;
                    gvSOrder.DataBind();
                }
            }
            catch (Exception ex)
            {
                throw ex;
            }
            finally
            {
                oblSalesOrder     = null;
                objSalesOrderList = null;
            }
        }
Exemple #2
0
        public string insertSalesOrder(string cpsubtotal, string spsubtotal, string dicpre, string dic, string tax, string shc, string misccost, string ttotal)
        {
            oblSalesOrder = new Store.SalesOrder.BusinessLogic.SalesOrder();
            //oblPurchaseOrder = new Store.PurchaseOrder.BusinessLogic.PurchaseOrder();
            objMessageInfo = new MessageInfo();
            objSalesOrder  = new Store.SalesOrder.BusinessObject.SalesOrder();
            //objPurchaseOrder = new Store.PurchaseOrder.BusinessObject.PurchaseOrder();
            if (cmdMode == Store.Common.CommandMode.M)
            {
                objSalesOrder.SalesOrderID = Convert.ToInt32(hfPId.Value);
                // objPurchaseOrder.PurchaseOrderID = Convert.ToInt32(hfPId.Value);//PurchaseOrderID which edit from data grid
            }
            else
            {
                objSalesOrder.SalesOrderID = 0;
                //objPurchaseOrder.PurchaseOrderID = 0;
            }
            objSalesOrder.SalesOrderID           = 0;
            objSalesOrder.VendorID               = Convert.ToInt32(hfVendor.Value);
            objSalesOrder.TotalCostAmount        = Convert.ToDecimal(cpsubtotal);
            objSalesOrder.TotalSaleAmount        = Convert.ToDecimal(spsubtotal);
            objSalesOrder.TotalTaxValue          = Convert.ToDecimal(tax);
            objSalesOrder.ShipingAndHandlingCost = Convert.ToDecimal(shc);
            objSalesOrder.MiscSaleAmount         = Convert.ToDecimal(misccost);
            objSalesOrder.DiscountPer            = Convert.ToDecimal(dicpre);
            objSalesOrder.Discount               = Convert.ToDecimal(dic);
            objSalesOrder.IsActive               = 1;
            objMessageInfo = oblSalesOrder.ManageSaleOrder(objSalesOrder, cmdMode);

            return(objMessageInfo.TranID.ToString());
        }
Exemple #3
0
        void bindSales(int id)
        {
            oblSales = new Store.SalesOrder.BusinessLogic.SalesOrder();

            try
            {
                objSales = oblSales.GetAllSalesOrder(id, 0, "");
                if (objSales != null)
                {
                    txtSubTotal.Text = objSales.TotalSaleAmount.ToString();
                    txtTax.Text      = objSales.TotalTaxValue.ToString();
                    txtSHC.Text      = objSales.ShipingAndHandlingCost.ToString();
                    txtMiscCost.Text = objSales.MiscSaleAmount.ToString();
                }
                else
                {
                    txtSubTotal.Text = "";
                    txtTax.Text      = "";
                    txtSHC.Text      = "";
                }  txtMiscCost.Text = "";
            }
            catch (Exception ex)
            {
                Store.Common.Utility.ExceptionLog.Exceptionlogs(ex.Message, Store.Common.Utility.ExceptionLog.LineNumber(ex), typeof(SalesRtn).FullName, 1);
            }
            finally
            {
                oblSales = null;
                objSales = null;
            }
        }
Exemple #4
0
 public Store.Common.MessageInfo ManageSaleOrder(Store.SalesOrder.BusinessObject.SalesOrder objSalesOrder, CommandMode cmdMode)
 {
     try
     {
         return(odlSalesOrder.ManageSalesOrder(objSalesOrder, cmdMode));
     }
     catch (Exception ex)
     {
         Store.Common.Utility.ExceptionLog.Exceptionlogs(ex.Message, Store.Common.Utility.ExceptionLog.LineNumber(ex), typeof(SalesOrder).FullName, 1);
         return(null);
     }
 }
Exemple #5
0
        void ManageSalesOrder()
        {
            objSalesOrder = new Store.SalesOrder.BusinessObject.SalesOrder();
            odlSalesOrder = new Store.SalesOrder.BusinessLogic.SalesOrder();


            try
            {
                if (cmdMode == Store.Common.CommandMode.M)
                {
                    objSalesOrder.SalesOrderID = Convert.ToInt32(txtSalesOrderID.Text);
                }
                else
                {
                    objSalesOrder.SalesOrderID = 0;
                }
                objSalesOrder.VendorID = Convert.ToInt16(ddlVendor.SelectedItem.Value);
                DateTime date = DateTime.Parse(txtSDate.Text);
                objSalesOrder.SaleDate               = date;
                objSalesOrder.TotalCostAmount        = Convert.ToDecimal(txtTotalCostAmount.Text);
                objSalesOrder.TotalSaleAmount        = Convert.ToDecimal(txtTotalSaleAmount.Text);
                objSalesOrder.TotalDiscountAmount    = Convert.ToDecimal(txtTotalDiscountAmount.Text);
                objSalesOrder.TotalTaxValue          = Convert.ToDecimal(txtTaxValue.Text);
                objSalesOrder.ShipingAndHandlingCost = Convert.ToDecimal(txtSHCost.Text);
                objSalesOrder.MiscSaleAmount         = Convert.ToDecimal(txtMiscCost.Text);

                if (cbIsActive.Checked)
                {
                    objSalesOrder.IsActive = 1;
                }
                else
                {
                    objSalesOrder.IsActive = 0;
                }


                objSalesOrder.CreatedBy = 1;
                objMessageInfo          = odlSalesOrder.ManageItemMaster(objSalesOrder, cmdMode);
            }
            catch (Exception ex)
            {
            }
            finally
            {
                objSalesOrder = null;
                //objMessageInfo = null;
                odlSalesOrder = null;
            }
        }
Exemple #6
0
 public string insertOrder(string totalc, string totals, string totald, string tax, string shc, string misccost)
 {
     Store.SalesOrder.BusinessLogic.SalesOrder oblSalesOrder = new Store.SalesOrder.BusinessLogic.SalesOrder();
     Store.Common.MessageInfo objMessageInfo = new MessageInfo();
     Store.SalesOrder.BusinessObject.SalesOrder objSalesOrder = new Store.SalesOrder.BusinessObject.SalesOrder();
     objSalesOrder.SalesOrderID = 0;
     objSalesOrder.VendorID     = 0;
     //objSalesOrder.SaleDate=
     objSalesOrder.TotalCostAmount        = Convert.ToDecimal(totalc);
     objSalesOrder.TotalSaleAmount        = Convert.ToDecimal(totals);
     objSalesOrder.TotalDiscountAmount    = Convert.ToDecimal(totald);
     objSalesOrder.TotalTaxValue          = Convert.ToDecimal(tax);
     objSalesOrder.ShipingAndHandlingCost = Convert.ToDecimal(shc);
     objSalesOrder.MiscSaleAmount         = Convert.ToDecimal(misccost);
     // objMessageInfo = oblSalesOrder.ManageSaleOrder(objSalesOrder,cmdMode);
     return(objMessageInfo.TranID.ToString());
 }
Exemple #7
0
        public Store.Common.MessageInfo ManageSalesOrder(Store.SalesOrder.BusinessObject.SalesOrder objSalesOrder, CommandMode cmdMode)
        {
            string          SQL   = "USP_ManageSales";
            ParameterList   param = new ParameterList();
            DataTableReader dr;

            Store.Common.MessageInfo objMessageInfo = null;
            try
            {
                SQL = "USP_ManageSales";
                param.Add(new SQLParameter("@SalesOrderID", objSalesOrder.SalesOrderID));
                param.Add(new SQLParameter("@VendorID", objSalesOrder.VendorID));
                //param.Add(new SQLParameter("@SaleDate", objSalesOrder.SaleDate));
                param.Add(new SQLParameter("@TotalCostAmount", objSalesOrder.TotalCostAmount));
                param.Add(new SQLParameter("@TotalSaleAmount", objSalesOrder.TotalSaleAmount));
                param.Add(new SQLParameter("@TotalDiscountAmount", objSalesOrder.TotalDiscountAmount));
                param.Add(new SQLParameter("@TotalTaxValue", objSalesOrder.TotalTaxValue));
                param.Add(new SQLParameter("@ShipingAndHandlingCost", objSalesOrder.ShipingAndHandlingCost));
                param.Add(new SQLParameter("@MiscSaleAmount", objSalesOrder.MiscSaleAmount));
                param.Add(new SQLParameter("@IsActive", objSalesOrder.IsActive));
                param.Add(new SQLParameter("@ReferenceID", objSalesOrder.ReferenceID));
                param.Add(new SQLParameter("@UserId", objSalesOrder.CreatedBy));
                param.Add(new SQLParameter("@CMDMode", cmdMode));
                dr = ExecuteQuery.ExecuteReader(SQL, param);
                if (dr.Read())
                {
                    objMessageInfo              = new Store.Common.MessageInfo();
                    objMessageInfo.ErrorCode    = Convert.ToInt32(dr["ErrorCode"]);
                    objMessageInfo.ErrorMessage = Convert.ToString(dr["ErrorMessage"]);
                    objMessageInfo.TranID       = Convert.ToInt32(dr["TranID"]);
                    objMessageInfo.TranCode     = Convert.ToString(dr["TranCode"]);
                    objMessageInfo.TranMessage  = Convert.ToString(dr["TranMessage"]);
                }
            }
            catch (Exception ex)
            {
                Store.Common.Utility.ExceptionLog.Exceptionlogs(ex.Message, Store.Common.Utility.ExceptionLog.LineNumber(ex), typeof(SalesOrder).FullName, 1);
            }
            return(objMessageInfo);
        }
Exemple #8
0
        protected void imgbtnfrDelete_Click(object sender, ImageClickEventArgs e)
        {
            cmdMode       = CommandMode.D;
            objSalesOrder = new Store.SalesOrder.BusinessObject.SalesOrder();
            odlSalesOrder = new Store.SalesOrder.BusinessLogic.SalesOrder();


            try
            {
                ImageButton btndetails = sender as ImageButton;
                GridViewRow gvrow      = (GridViewRow)btndetails.NamingContainer;
                objSalesOrder.SalesOrderID           = Convert.ToInt32(dgvSalesOrder.DataKeys[gvrow.RowIndex].Value.ToString());
                objSalesOrder.VendorID               = 0;
                objSalesOrder.SaleDate               = DateTime.Now;
                objSalesOrder.TotalCostAmount        = 0;
                objSalesOrder.TotalSaleAmount        = 0;
                objSalesOrder.TotalTaxValue          = 0;
                objSalesOrder.TotalDiscountAmount    = 0;
                objSalesOrder.ShipingAndHandlingCost = 0;
                objSalesOrder.MiscSaleAmount         = 0;
                objSalesOrder.IsActive               = 1;
                objSalesOrder.ClientID               = 0;
                objSalesOrder.CreatedBy              = 1;
                objMessageInfo = odlSalesOrder.ManageItemMaster(objSalesOrder, cmdMode);
                BindSalesOrder();
                updateSalesOrderBdInfo.Update();
            }
            catch (Exception ex)
            {
                throw;
            }
            finally
            {
                objSalesOrder  = null;
                objMessageInfo = null;
                odlSalesOrder  = null;
            }
        }
Exemple #9
0
        public Store.SalesOrder.BusinessObject.SalesOrder GetAllSalesOrder(int SalesOrderID, int Flag, string FlagValue)
        {
            Store.SalesOrder.BusinessObject.SalesOrder objSalesOrder = null;
            string          SQL       = string.Empty;
            ParameterList   paramList = new ParameterList();
            DataTableReader dr;

            try
            {
                SQL = "proc_SalesOrder";
                paramList.Add(new SQLParameter("@SalesOrderID", SalesOrderID));
                paramList.Add(new SQLParameter("@Flag", Flag));
                paramList.Add(new SQLParameter("@FlagValue", FlagValue));
                dr = ExecuteQuery.ExecuteReader(SQL, paramList);
                while (dr.Read())
                {
                    objSalesOrder = new BusinessObject.SalesOrder();

                    if (dr.IsDBNull(dr.GetOrdinal("SalesOrderID")) == false)
                    {
                        objSalesOrder.SalesOrderID = dr.GetInt32(dr.GetOrdinal("SalesOrderID"));
                    }
                    if (dr.IsDBNull(dr.GetOrdinal("VendorID")) == false)
                    {
                        objSalesOrder.VendorID = dr.GetInt32(dr.GetOrdinal("VendorID"));
                    }
                    //if (dr.IsDBNull(dr.GetOrdinal("VendorName")) == false)
                    //{
                    //    objSalesOrder.VendorName = dr.GetString(dr.GetOrdinal("VendorName"));
                    //}
                    if (dr.IsDBNull(dr.GetOrdinal("SaleDate")) == false)
                    {
                        objSalesOrder.SaleDate = dr.GetDateTime(dr.GetOrdinal("SaleDate"));
                    }
                    if (dr.IsDBNull(dr.GetOrdinal("TotalCostAmount")) == false)
                    {
                        objSalesOrder.TotalCostAmount = dr.GetDecimal(dr.GetOrdinal("TotalCostAmount"));
                    }
                    if (dr.IsDBNull(dr.GetOrdinal("TotalSaleAmount")) == false)
                    {
                        objSalesOrder.TotalSaleAmount = dr.GetDecimal(dr.GetOrdinal("TotalSaleAmount"));
                    }
                    if (dr.IsDBNull(dr.GetOrdinal("TotalDiscountAmount")) == false)
                    {
                        objSalesOrder.TotalDiscountAmount = dr.GetDecimal(dr.GetOrdinal("TotalDiscountAmount"));
                    }
                    if (dr.IsDBNull(dr.GetOrdinal("TotalTaxValue")) == false)
                    {
                        objSalesOrder.TotalTaxValue = dr.GetDecimal(dr.GetOrdinal("TotalTaxValue"));
                    }
                    if (dr.IsDBNull(dr.GetOrdinal("ShipingAndHandlingCost")) == false)
                    {
                        objSalesOrder.ShipingAndHandlingCost = dr.GetDecimal(dr.GetOrdinal("ShipingAndHandlingCost"));
                    }
                    if (dr.IsDBNull(dr.GetOrdinal("MiscSaleAmount")) == false)
                    {
                        objSalesOrder.MiscSaleAmount = dr.GetDecimal(dr.GetOrdinal("MiscSaleAmount"));
                    }
                    if (dr.IsDBNull(dr.GetOrdinal("ClientID")) == false)
                    {
                        objSalesOrder.ClientID = dr.GetInt32(dr.GetOrdinal("ClientID"));
                    }
                    if (dr.IsDBNull(dr.GetOrdinal("ClientID")) == false)
                    {
                        objSalesOrder.ClientID = dr.GetInt32(dr.GetOrdinal("ClientID"));
                    }
                    if (dr.IsDBNull(dr.GetOrdinal("CreatedBy")) == false)
                    {
                        objSalesOrder.CreatedBy = dr.GetInt32(dr.GetOrdinal("CreatedBy"));
                    }
                    if (dr.IsDBNull(dr.GetOrdinal("CreatedOn")) == false)
                    {
                        objSalesOrder.CreatedOn = dr.GetDateTime(dr.GetOrdinal("CreatedOn"));
                    }
                    if (dr.IsDBNull(dr.GetOrdinal("ModifiedBy")) == false)
                    {
                        objSalesOrder.ModifiedBy = dr.GetInt32(dr.GetOrdinal("ModifiedBy"));
                    }
                    if (dr.IsDBNull(dr.GetOrdinal("ModifiedOn")) == false)
                    {
                        objSalesOrder.ModifiedOn = dr.GetDateTime(dr.GetOrdinal("ModifiedOn"));
                    }
                    if (dr.IsDBNull(dr.GetOrdinal("ReferenceID")) == false)
                    {
                        objSalesOrder.ReferenceID = dr.GetInt32(dr.GetOrdinal("ReferenceID"));
                    }
                    if (dr.IsDBNull(dr.GetOrdinal("IsActive")) == false)
                    {
                        objSalesOrder.IsActive = dr.GetInt32(dr.GetOrdinal("IsActive"));
                    }
                }
                dr.Close();
            }

            catch (Exception ex)
            {
                Store.Common.Utility.ExceptionLog.Exceptionlogs(ex.Message, Store.Common.Utility.ExceptionLog.LineNumber(ex), typeof(SalesOrder).FullName, 1);
            }
            return(objSalesOrder);
        }