Пример #1
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;
            }
        }
Пример #2
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;
            }
        }
Пример #3
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;
     }
 }
Пример #4
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());
        }
Пример #5
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;
            }
        }
Пример #6
0
        //public Store.Common.MessageInfo ManagePurchaseReceived(Store.PurchaseReceived.BusinessObject.PurchaseReceived objPurchaseReceived, int cmdMode) by depk
        public Store.Common.MessageInfo ManagePurchaseReceived(Store.PurchaseReceived.BusinessObject.PurchaseReceived objPurchaseReceived, CommandMode cmdMode)
        {
            string          SQL   = "";
            ParameterList   param = new ParameterList();
            DataTableReader dr;

            Store.Common.MessageInfo objMessageInfo = null;
            try
            {
                SQL = "USP_ManagePurchaseReceived";
                param.Add(new SQLParameter("@PurchaseReceivedID", objPurchaseReceived.PurchaseReceivedID));
                param.Add(new SQLParameter("@PurchaseOrderID", objPurchaseReceived.PurchaseOrderID));
                param.Add(new SQLParameter("@VendorID", objPurchaseReceived.VendorID));
                param.Add(new SQLParameter("@PurchaseAmount", objPurchaseReceived.PurchaseAmount));
                param.Add(new SQLParameter("@TaxValue", objPurchaseReceived.TaxValue));
                param.Add(new SQLParameter("@ShipingAndHandlingCost", objPurchaseReceived.ShipingAndHandlingCost));
                param.Add(new SQLParameter("@MiscCost", objPurchaseReceived.MiscCost));
                param.Add(new SQLParameter("@IsActive", objPurchaseReceived.IsActive));
                param.Add(new SQLParameter("@ReferenceID", objPurchaseReceived.ReferenceID));
                param.Add(new SQLParameter("@UserId", objPurchaseReceived.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(PurchaseReceived).FullName, 1);
            }
            return(objMessageInfo);
        }
Пример #7
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());
        }
Пример #8
0
        public Store.PurchaseReceived.BusinessObject.PurchaseReceived GetAllPurchaseReceived(int PurchaseReceivedID, int Flag, string FlagValue)
        {
            Store.PurchaseReceived.BusinessObject.PurchaseReceived objPurchaseReceived = null;
            string          SQL       = string.Empty;
            ParameterList   paramList = new ParameterList();
            DataTableReader dr;

            try
            {
                SQL = "proc_PurchaseReceived";
                paramList.Add(new SQLParameter("@PurchaseReceivedID", PurchaseReceivedID));
                paramList.Add(new SQLParameter("@Flag", Flag));
                paramList.Add(new SQLParameter("@FlagValue", FlagValue));
                dr = ExecuteQuery.ExecuteReader(SQL, paramList);
                while (dr.Read())
                {
                    objPurchaseReceived = new BusinessObject.PurchaseReceived();
                    if (dr.IsDBNull(dr.GetOrdinal("PurchaseReceivedID")) == false)
                    {
                        objPurchaseReceived.PurchaseReceivedID = dr.GetInt32(dr.GetOrdinal("PurchaseReceivedID"));
                    }
                    if (dr.IsDBNull(dr.GetOrdinal("PurchaseOrderID")) == false)
                    {
                        objPurchaseReceived.PurchaseOrderID = dr.GetInt32(dr.GetOrdinal("PurchaseOrderID"));
                    }
                    if (dr.IsDBNull(dr.GetOrdinal("VendorID")) == false)
                    {
                        objPurchaseReceived.VendorID = dr.GetInt32(dr.GetOrdinal("VendorID"));
                    }
                    if (dr.IsDBNull(dr.GetOrdinal("PurchaseRecivedDate")) == false)
                    {
                        objPurchaseReceived.PurchaseRecivedDate = dr.GetDateTime(dr.GetOrdinal("PurchaseRecivedDate"));
                    }
                    if (dr.IsDBNull(dr.GetOrdinal("PurchaseAmount")) == false)
                    {
                        objPurchaseReceived.PurchaseAmount = dr.GetDecimal(dr.GetOrdinal("PurchaseAmount"));
                    }
                    if (dr.IsDBNull(dr.GetOrdinal("TaxValue")) == false)
                    {
                        objPurchaseReceived.TaxValue = dr.GetDecimal(dr.GetOrdinal("TaxValue"));
                    }
                    if (dr.IsDBNull(dr.GetOrdinal("ShippingHandlingCost")) == false)
                    {
                        objPurchaseReceived.ShipingAndHandlingCost = dr.GetDecimal(dr.GetOrdinal("ShipingAndHandlingCost"));
                    }
                    if (dr.IsDBNull(dr.GetOrdinal("MiscCost")) == false)
                    {
                        objPurchaseReceived.MiscCost = dr.GetDecimal(dr.GetOrdinal("MiscCost"));
                    }
                    if (dr.IsDBNull(dr.GetOrdinal("ClientID")) == false)
                    {
                        objPurchaseReceived.ClientID = dr.GetInt32(dr.GetOrdinal("ClientID"));
                    }
                    if (dr.IsDBNull(dr.GetOrdinal("CreatedBy")) == false)
                    {
                        objPurchaseReceived.CreatedBy = dr.GetInt32(dr.GetOrdinal("CreatedBy"));
                    }
                    if (dr.IsDBNull(dr.GetOrdinal("CreatedOn")) == false)
                    {
                        objPurchaseReceived.CreatedOn = dr.GetDateTime(dr.GetOrdinal("CreatedOn"));
                    }
                    if (dr.IsDBNull(dr.GetOrdinal("ModifiedBy")) == false)
                    {
                        objPurchaseReceived.ModifiedBy = dr.GetInt32(dr.GetOrdinal("ModifiedBy"));
                    }
                    if (dr.IsDBNull(dr.GetOrdinal("ModifiedOn")) == false)
                    {
                        objPurchaseReceived.ModifiedOn = dr.GetDateTime(dr.GetOrdinal("ModifiedOn"));
                    }
                    if (dr.IsDBNull(dr.GetOrdinal("ReferenceID")) == false)
                    {
                        objPurchaseReceived.ReferenceID = dr.GetInt32(dr.GetOrdinal("ReferenceID"));
                    }
                    if (dr.IsDBNull(dr.GetOrdinal("IsActive")) == false)
                    {
                        objPurchaseReceived.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(PurchaseReceived).FullName, 1);
            }
            return(objPurchaseReceived);
        }