Пример #1
0
 void BindPurchaseReceived()
 {
     oblPurchaseReceived = new Store.PurchaseReceived.BusinessLogic.PurchaseReceived();
     try
     {
         objPurchaseReceivedList = oblPurchaseReceived.GetAllPurchaseReceivedList(0, 0, "");
         if (objPurchaseReceivedList != null)
         {
             ddlPurchaseReceivedId.DataSource = objPurchaseReceivedList;
             // ddlPurchaseOrderId.DataTextField = "StateName";
             ddlPurchaseReceivedId.DataValueField = "PurchaseReceivedID";
             ddlPurchaseReceivedId.DataBind();
             //ddlState.Items.FindByValue(db.Table.Rows[0]["StateID"].ToString()).Selected=true;
         }
         else
         {
             ddlPurchaseReceivedId.DataSource = null;
             ddlPurchaseReceivedId.DataBind();
         }
     }
     catch (Exception)
     {
         throw;
     }
     finally
     {
         oblPurchaseReceived     = null;
         objPurchaseReceivedList = null;
     }
 }
Пример #2
0
 private void bindPRecived()
 {
     try
     {
         oblPurchaseReceived     = new Store.PurchaseReceived.BusinessLogic.PurchaseReceived();
         objPurchaseReceivedList = new Store.PurchaseReceived.BusinessObject.PurchaseReceivedList();
         objPurchaseReceivedList = oblPurchaseReceived.GetAllPurchaseReceivedList(0, 0, "");
         if (objPurchaseReceivedList != null)
         {
             gvPOrder.DataSource = objPurchaseReceivedList;
             gvPOrder.DataBind();
         }
         else
         {
             gvPOrder.DataSource = null;
             gvPOrder.DataBind();
         }
     }
     catch (Exception ex)
     {
         throw ex;
     }
     finally
     {
         oblPurchaseReceived     = null;
         objPurchaseReceivedList = null;
     }
 }
Пример #3
0
        public string insertOrder(string tax, string shc, string misccost, string ttotal)
        {
            try
            {
                objPurchaseReceived = new Store.PurchaseReceived.BusinessObject.PurchaseReceived();
                objMessageInfo      = new MessageInfo();
                oblPurchaseReceived = new Store.PurchaseReceived.BusinessLogic.PurchaseReceived();
                objPurchaseReceived.PurchaseOrderID        = Convert.ToInt32(txtPoId.Text);
                objPurchaseReceived.PurchaseReceivedID     = 0;
                objPurchaseReceived.VendorID               = 0;
                objPurchaseReceived.PurchaseAmount         = Convert.ToDecimal(ttotal);
                objPurchaseReceived.TaxValue               = Convert.ToDecimal(tax);
                objPurchaseReceived.ShipingAndHandlingCost = Convert.ToDecimal(shc);
                objPurchaseReceived.MiscCost               = Convert.ToDecimal(misccost);
                objPurchaseReceived.IsActive               = 1;
                //objMessageInfo = oblPurchaseReceived.ManagePurchaseReceived(objPurchaseReceived,1);by depk
                objMessageInfo = oblPurchaseReceived.ManagePurchaseReceived(objPurchaseReceived, cmdMode);

                return(objMessageInfo.TranID.ToString());
            }
            catch (Exception ex)
            { //Store.Common.Utility.ExceptionLog.Exceptionlogs(ex.Message, Store.Common.Utility.ExceptionLog.LineNumber(ex), typeof(WebForm1).FullName, 1);
            }
            finally
            {
                objMessageInfo      = null;
                objPurchaseReceived = null;
                oblPurchaseReceived = null;
            }
        }
Пример #4
0
        protected void imgbtnfrDelete_Click(object sender, ImageClickEventArgs e)
        {
            cmdMode             = CommandMode.D;
            oblPurchaseReceived = new Store.PurchaseReceived.BusinessLogic.PurchaseReceived();
            objPurchaseReceived = new Store.PurchaseReceived.BusinessObject.PurchaseReceived();

            objMessageInfo = new MessageInfo();
            try
            {
                ImageButton btndetails = sender as ImageButton;
                GridViewRow gvrow      = (GridViewRow)btndetails.NamingContainer;
                objPurchaseReceived.PurchaseReceivedID = Convert.ToInt32(gvPOrder.DataKeys[gvrow.RowIndex].Value.ToString());
                bindPRecived();
                if (objMessageInfo.TranID != 0)
                {
                    ScriptManager.RegisterStartupScript(this.Page, this.Page.GetType(), "alert", "alert('" + objMessageInfo.TranMessage + "')", true);
                }
                else if (objMessageInfo.ErrorCode == -101)
                {
                    ScriptManager.RegisterStartupScript(this.Page, this.Page.GetType(), "alert", "alert('" + objMessageInfo.ErrorMessage + "')", true);
                }
            }
            catch (Exception ex)
            {
                throw ex;
            }
            finally
            {
                objMessageInfo      = null;
                objPurchaseReceived = null;
                oblPurchaseReceived = null;
            }
        }
Пример #5
0
        public string insertItem(string name, string description, string unitprice, string quantity, string transId)
        {
            try
            {
                objPurchaseReceivedItem = new Store.PurchaseReceivedItem.BusinessObject.PurchaseReceivedItem();
                objMessageInfo          = new MessageInfo();
                oblPurchaseReceived     = new Store.PurchaseReceived.BusinessLogic.PurchaseReceived();
                objPurchaseReceivedItem.PurchaseItemReceivedID = 0;
                objPurchaseReceivedItem.PurchaseOrderID        = Convert.ToInt32(txtPoId.Text);
                objPurchaseReceivedItem.PurchaseReceivedID     = Convert.ToInt32(transId);
                objPurchaseReceivedItem.ItemID      = 0;
                objPurchaseReceivedItem.ItemPrefix  = name;
                objPurchaseReceivedItem.ItemUnit    = quantity;
                objPurchaseReceivedItem.Description = description;
                objPurchaseReceivedItem.ItemPrice   = Convert.ToDecimal(unitprice);
                objPurchaseReceivedItem.IsActive    = 1;
                objMessageInfo = oblPurchaseReceived.ManagePurchaseReceivedItem(objPurchaseReceivedItem, cmdMode);

                //objPurchaseOrder = new Store.PurchaseOrder.BusinessObject.PurchaseOrder();

                return("");
            }
            catch (Exception ex)
            {// Store.Common.Utility.ExceptionLog.Exceptionlogs(ex.Message, Store.Common.Utility.ExceptionLog.LineNumber(ex), typeof(WebForm1).FullName, 1);
            }
            finally
            {
                objPurchaseReceivedItem = null;
                oblPurchaseReceived     = null;
                objMessageInfo          = null;
            }
        }
Пример #6
0
 protected void imgbtnfrDelete_Click(object sender, ImageClickEventArgs e)
 {
     cmdMode             = CommandMode.D;
     objPurchaseReceived = new Store.PurchaseReceived.BusinessObject.PurchaseReceived();
     oblPurchaseReceived = new Store.PurchaseReceived.BusinessLogic.PurchaseReceived();
     try
     {
         ImageButton btndetails = sender as ImageButton;
         GridViewRow gvrow      = (GridViewRow)btndetails.NamingContainer;
         objPurchaseReceived.PurchaseReceivedID     = Convert.ToInt32(dgvPurchaseReceived.DataKeys[gvrow.RowIndex].Value.ToString());
         objPurchaseReceived.VendorID               = 1;
         objPurchaseReceived.PurchaseRecivedDate    = DateTime.Now;
         objPurchaseReceived.PurchaseAmount         = 2;
         objPurchaseReceived.TaxValue               = 3;
         objPurchaseReceived.ShipingAndHandlingCost = 4;
         objPurchaseReceived.PurchaseOrderID        = 5;
         objPurchaseReceived.CreatedBy              = 1;
         //objMessageInfo =oblPurchaseReceived.ManagePurchaseOrderMaster(objPurchaseReceived, cmdMode);
         BindPurchaseReceived();
         updatePurchasedReceivedBdInfo.Update();
     }
     catch (Exception ex)
     {
         throw;
     }
     finally
     {
         objPurchaseReceived = null;
         objMessageInfo      = null;
         oblPurchaseReceived = null;
     }
 }
Пример #7
0
        void BindPurchaseReceived()
        {
            oblPurchaseReceived = new Store.PurchaseReceived.BusinessLogic.PurchaseReceived();
            try
            {
                objPurchaseReceivedList = oblPurchaseReceived.GetAllPurchaseReceivedList(0, 0, "");

                if (objPurchaseReceivedList != null)
                {
                    dgvPurchaseReceived.DataSource = objPurchaseReceivedList;
                    dgvPurchaseReceived.DataBind();
                }
                else
                {
                    dgvPurchaseReceived.DataSource = null;
                    dgvPurchaseReceived.DataBind();
                }
            }
            catch (Exception ex)
            {
            }
            finally
            {
                oblPurchaseReceived     = null;
                objPurchaseReceivedList = null;
            }
        }
Пример #8
0
        public static string insertpurchase(string subtotal, string dicpre, string dic, string tax, string shc, string misccost, string ttotal)
        {
            Store.PurchaseReceived.BusinessLogic.PurchaseReceived  objPurchaseReceived = new Store.PurchaseReceived.BusinessLogic.PurchaseReceived();
            Store.PurchaseReceived.BusinessObject.PurchaseReceived objPurchaseReceived = new Store.PurchaseReceived.BusinessObject.PurchaseReceived();
            Store.Common.MessageInfo objMessageInfo = new MessageInfo();
            objPurchaseReceived.PurchaseReceivedID     = 0;
            objPurchaseReceived.VendorID               = 0;
            objPurchaseReceived.PurchaseAmount         = Convert.ToDecimal(ttotal);
            objPurchaseReceived.TaxValue               = Convert.ToDecimal(tax);
            objPurchaseReceived.ShipingAndHandlingCost = Convert.ToDecimal(shc);
            objPurchaseReceived.MiscCost               = Convert.ToDecimal(misccost);
            objPurchaseReceived.PDiscountPre           = Convert.ToDecimal(dicpre);
            objPurchaseReceived.PDiscount              = Convert.ToDecimal(dic);
            objMessageInfo = objPurchaseReceived.ManagePurchaseOrder(objPurchaseOrder, 1);

            return("".ToString());
        }
Пример #9
0
        void ManagePurchaseReceived()
        {
            objPurchaseReceived = new Store.PurchaseReceived.BusinessObject.PurchaseReceived();
            oblPurchaseReceived = new Store.PurchaseReceived.BusinessLogic.PurchaseReceived();

            try
            {
                if (cmdMode == Store.Common.CommandMode.M)

                {
                    objPurchaseReceived.PurchaseReceivedID = Convert.ToInt32(txtPurchaseReceivedID.Text);
                }
                else
                {
                    objPurchaseReceived.PurchaseReceivedID = 0;
                }
                objPurchaseReceived.VendorID               = Convert.ToInt32(ddlVendor.SelectedItem.Value);
                objPurchaseReceived.PurchaseRecivedDate    = Convert.ToDateTime(txtPurchaseReceivedDate.Text);
                objPurchaseReceived.PurchaseAmount         = Convert.ToDecimal(txtPurchaseAmount.Text);
                objPurchaseReceived.TaxValue               = Convert.ToDecimal(txtTaxValue.Text);
                objPurchaseReceived.ShipingAndHandlingCost = Convert.ToDecimal(txtShippingHandlingCost.Text);
                objPurchaseReceived.MiscCost               = Convert.ToDecimal(txtMiscCost.Text);
                objPurchaseReceived.PurchaseOrderID        = Convert.ToInt16(ddlPurchaseOrderID.SelectedItem.Value);
                if (chkBoxIsActive.Checked)
                {
                    objPurchaseReceived.IsActive = 1;
                }
                else
                {
                    objPurchaseReceived.IsActive = 0;
                }

                objPurchaseReceived.CreatedBy = 1;
                //objMessageInfo =oblPurchaseReceived.ManagePurchaseOrderMaster(objPurchaseReceived, cmdMode);
            }
            catch (Exception ex)
            {
            }
            finally
            {
                objPurchaseReceived = null;
                //objMessageInfo = null;
                oblPurchaseReceived = null;
            }
        }
Пример #10
0
        public string insertReceived(string subtotal, string tax, string shc, string misccost, string ttotal)
        {
            oblPurchaseReceived = new Store.PurchaseReceived.BusinessLogic.PurchaseReceived();
            objMessageInfo      = new MessageInfo();
            objPurchaseReceived = new Store.PurchaseReceived.BusinessObject.PurchaseReceived();
            if (cmdMode == Store.Common.CommandMode.M)
            {
                objPurchaseReceived.PurchaseReceivedID = Convert.ToInt32(hfPId.Value);//PurchaseReceivedID which edit from data grid
            }
            else
            {
                objPurchaseReceived.PurchaseReceivedID = 0;
            }
            objPurchaseReceived.PurchaseOrderID        = Convert.ToInt32(hfPOrder.Value);
            objPurchaseReceived.VendorID               = Convert.ToInt32(hfVendor.Value);
            objPurchaseReceived.PurchaseAmount         = Convert.ToDecimal(ttotal);
            objPurchaseReceived.TaxValue               = Convert.ToDecimal(tax);
            objPurchaseReceived.ShipingAndHandlingCost = Convert.ToDecimal(shc);
            objPurchaseReceived.MiscCost               = Convert.ToDecimal(misccost);
            objPurchaseReceived.IsActive               = 1;
            objMessageInfo = oblPurchaseReceived.ManagePurchaseReceived(objPurchaseReceived, cmdMode);

            return(objMessageInfo.TranID.ToString());
        }