Пример #1
0
        protected void txtItemName_TextChanged(object sender, EventArgs e)
        {
            int     rows   = Convert.ToInt32(((TextBox)sender).Attributes["Rowid"].ToString());
            TextBox name   = (TextBox)Gridview1.Rows[rows].FindControl("txtItemName");
            TextBox dec    = (TextBox)Gridview1.Rows[rows].FindControl("txtDis");
            TextBox priceS = (TextBox)Gridview1.Rows[rows].FindControl("txtSaleAmount");
            TextBox dicPre = (TextBox)Gridview1.Rows[rows].FindControl("txtDisPer");
            TextBox disAmt = (TextBox)Gridview1.Rows[rows].FindControl("txtDisAmt");
            TextBox priceC = (TextBox)Gridview1.Rows[rows].FindControl("txtCostAmount");
            TextBox qut    = (TextBox)Gridview1.Rows[rows].FindControl("txtQut");

            string item = name.Text;

            Store.Item.BusinessObject.Item objItem = new Store.Item.BusinessObject.Item();
            Store.Item.BusinessLogic.Item  oblItem = new Store.Item.BusinessLogic.Item();
            objItem = oblItem.GetAllItem(item, 0, "");

            dec.Text = objItem.ItemDescription;

            Store.ItemPrice.BusinessObject.ItemPrice objItemPrice = new Store.ItemPrice.BusinessObject.ItemPrice();
            Store.ItemPrice.BusinessLogic.ItemPrice  oblItemPrice = new Store.ItemPrice.BusinessLogic.ItemPrice();
            objItemPrice = oblItemPrice.GetAllItemPrice(0, 0, "");
            //Cost price and sale price will come from itemPrice table
            priceC.Text = Convert.ToString(objItemPrice.ItemCostPricePerUnit);
            priceS.Text = Convert.ToString(objItemPrice.ItemSalePricePerUnit);
            dicPre.Text = Convert.ToString(objItemPrice.ItemDiscountPercentagePerUnit);
            disAmt.Text = Convert.ToString((Convert.ToDouble(priceS.Text) * Convert.ToDouble(dicPre.Text)) / 100);
            qut.Focus();
        }
Пример #2
0
        void UpdateItemPrice()
        {
            objItemPrice = new Store.ItemPrice.BusinessObject.ItemPrice();
            oblItemPrice = new Store.ItemPrice.BusinessLogic.ItemPrice();


            try
            {
                objItemPrice.ItemPriceID                   = Convert.ToInt32(hfItemPriceId.Value);
                objItemPrice.ItemSalePricePerUnit          = Convert.ToDecimal(txtSP.Text);
                objItemPrice.ItemDiscountPercentagePerUnit = Convert.ToDecimal(txtDisPerUnit.Text);
                objItemPrice.ApplicableFrom                = Convert.ToDateTime(txtApplicableFrom.Text);
                objItemPrice.ApplicableTo                  = Convert.ToDateTime(txtApplicableTo.Text);
                objMessageInfo = oblItemPrice.ManageItemMaster(objItemPrice, cmdMode);
            }
            catch (Exception ex)
            {
                Store.Common.Utility.ExceptionLog.Exceptionlogs(ex.Message, Store.Common.Utility.ExceptionLog.LineNumber(ex), typeof(ItemPrice).FullName, 1);
            }
            finally
            {
                objItemPrice = null;
                oblItemPrice = null;
            }
        }
Пример #3
0
        void bindBatch(int ItemId)
        {
            oblItemPrice = new Store.ItemPrice.BusinessLogic.ItemPrice();
            DataSet ds = new DataSet();

            try
            {
                ds = oblItemPrice.getBatch(ItemId);
                if (ds.Tables[0].Rows.Count > 0)
                {
                    dgvBatch.DataSource = ds;
                    dgvBatch.DataBind();
                    this.mpopBatch.Show();
                }
                else
                {
                    dgvBatch.DataSource = null;
                    dgvBatch.DataBind();
                    ScriptManager.RegisterStartupScript(this.Page, this.Page.GetType(), "alert", "alert('There is no batch for select item')", true);
                }
                upBatch.Update();
            }
            catch (Exception ex)
            {
                Store.Common.Utility.ExceptionLog.Exceptionlogs(ex.Message, Store.Common.Utility.ExceptionLog.LineNumber(ex), typeof(ItemPrice).FullName, 1);
            }
            finally
            {
                oblItemPrice = null;
                ds           = null;
            }
        }
Пример #4
0
        protected void ddlItemId_SelectedIndexChanged(object sender, EventArgs e)
        {
            int id = Convert.ToInt32(ddlItemId.SelectedValue);

            Store.Item.BusinessObject.Item objItem = new Store.Item.BusinessObject.Item();
            oblItem = new Store.Item.BusinessLogic.Item();
            Store.ItemPrice.BusinessObject.ItemPrice objItemPrice = new Store.ItemPrice.BusinessObject.ItemPrice();
            Store.ItemPrice.BusinessLogic.ItemPrice  oblItemPrice = new Store.ItemPrice.BusinessLogic.ItemPrice();
            objItemPrice = oblItemPrice.GetAllItemPrice(id, 0, "");
            //objItem = oblItem.GetAllItem(id, 0, "");
            txtItemUnit.Text    = objItem.UnitName;
            txtDescription.Text = objItem.ItemDescription;
            txtItemPrice.Text   = Convert.ToString(objItemPrice.ItemSalePricePerUnit);
        }
Пример #5
0
        protected void ddlItemId_SelectedIndexChanged(object sender, EventArgs e)
        {
            int id = Convert.ToInt32(ddlItemId.SelectedValue);

            Store.Item.BusinessObject.Item objItem = new Store.Item.BusinessObject.Item();
            oblItem = new Store.Item.BusinessLogic.Item();
            Store.ItemPrice.BusinessObject.ItemPrice objItemPrice = new Store.ItemPrice.BusinessObject.ItemPrice();
            Store.ItemPrice.BusinessLogic.ItemPrice  oblItemPrice = new Store.ItemPrice.BusinessLogic.ItemPrice();
            objItemPrice = oblItemPrice.GetAllItemPrice(id, 0, "");
            //objItem = oblItem.GetAllItem(id, 0, "");
            txtItemUnit.Text               = objItem.UnitName;
            txtDescription.Text            = objItem.ItemDescription;
            txtItemCostPrice.Text          = Convert.ToString(objItemPrice.ItemCostPricePerUnit);
            txtItemSalePrice.Text          = Convert.ToString(objItemPrice.ItemSalePricePerUnit);
            txtItemDiscountPercentage.Text = Convert.ToString(objItemPrice.ItemDiscountPercentagePerUnit);
            decimal sale     = Convert.ToDecimal(objItemPrice.ItemSalePricePerUnit);
            decimal discp    = Convert.ToDecimal(objItemPrice.ItemDiscountPercentagePerUnit);
            decimal discount = (sale * discp) / 100;

            txtItemDiscount.Text = Convert.ToString(discount);
        }