Exemple #1
0
 void BindItemUnit()
 {
     oblItemUnit = new Store.ItemUnit.BusinessLogic.ItemUnit();
     try
     {
         objItemUnitlist = oblItemUnit.GetAllItemUnitList(0, 0, "");
         if (objItemUnitlist != null)
         {
             ListItem al = new ListItem("<-Select Item Unit->", "0", true);
             ddlItemUnitId.DataSource     = objItemUnitlist;
             ddlItemUnitId.DataTextField  = "UnitName";
             ddlItemUnitId.DataValueField = "UnitID";
             ddlItemUnitId.DataBind();
             ddlItemUnitId.Items.Insert(0, al);
         }
         else
         {
             ddlItemUnitId.DataSource = null;
             ddlItemUnitId.DataBind();
         }
     }
     catch (Exception ex)
     {
         Store.Common.Utility.ExceptionLog.Exceptionlogs(ex.Message, Store.Common.Utility.ExceptionLog.LineNumber(ex), typeof(Item).FullName, 1);
     }
     finally
     {
         oblItemUnit     = null;
         objItemUnitlist = null;
     }
 }
Exemple #2
0
        //void BindCategory()
        //{
        //    oblCategory = new Store.Category.BusinessLogic.Category();
        //    try
        //    {
        //        obCategoryList = oblCategory.GetAllCategoryList(0, 0, "");
        //        if (obCategoryList != null)
        //        {
        //            ddlCategory.DataSource = obCategoryList;
        //            ddlCategory.DataTextField = "CategoryName";
        //            ddlCategory.DataValueField = "CategoryID";
        //            ddlCategory.DataBind();
        //            ddlCategory.Items.Insert(0, "<--Select Category-->");
        //        }
        //        else
        //        {
        //            ddlCategory.DataSource = null;
        //            ddlCategory.DataBind();
        //        }
        //    }
        //    catch (Exception ex)
        //    {
        // Store.Common.Utility.ExceptionLog.Exceptionlogs(ex.Message, Store.Common.Utility.ExceptionLog.LineNumber(ex), typeof(ItemUnit).FullName, 1);
        //    }
        //    finally
        //    {
        //        oblCategory = null;
        //        obCategoryList = null;
        //    }


        //}
        void ManageItemUnit()
        {
            objItemUnit = new Store.ItemUnit.BusinessObject.ItemUnit();
            oblItemUnit = new Store.ItemUnit.BusinessLogic.ItemUnit();
            try
            {
                if (cmdMode == Store.Common.CommandMode.M)
                {
                    objItemUnit.UnitID = Convert.ToInt32(txtUnitId.Text);
                    //objItemUnit.ModifiedBy = Convert.ToInt32(Session["UserId"]);
                }
                else
                {
                    objItemUnit.UnitID = 0;
                    //objItemUnit.CreatedBy = Convert.ToInt32(Session["UserId"]);
                }
                objItemUnit.UnitName = Convert.ToString(txtUnitName.Text);
                //objItemUnit.CategoryID = Convert.ToInt32(ddlCategory.SelectedItem.Value);

                objMessageInfo = oblItemUnit.ManageItemMaster(objItemUnit, cmdMode);
            }
            catch (Exception ex)
            {
                Store.Common.Utility.ExceptionLog.Exceptionlogs(ex.Message, Store.Common.Utility.ExceptionLog.LineNumber(ex), typeof(ItemUnit).FullName, 1);
            }
            finally
            {
                objItemUnit = null;
                //objMessageInfo = null;
                oblItemUnit = null;
            }
        }
Exemple #3
0
 protected void imgbtnfrDelete_Click(object sender, ImageClickEventArgs e)
 {
     cmdMode     = CommandMode.D;
     objItemUnit = new Store.ItemUnit.BusinessObject.ItemUnit();
     oblItemUnit = new Store.ItemUnit.BusinessLogic.ItemUnit();
     try
     {
         ImageButton btndetails = sender as ImageButton;
         GridViewRow gvrow      = (GridViewRow)btndetails.NamingContainer;
         objItemUnit.UnitID   = Convert.ToInt32(dgvItemUnit.DataKeys[gvrow.RowIndex].Value.ToString());
         objItemUnit.UnitName = "";
         //objItemUnit.CategoryID = 1;
         objItemUnit.CreatedBy = 1;
         objMessageInfo        = oblItemUnit.ManageItemMaster(objItemUnit, cmdMode);
         BindItemUnit();
         updateItemUnitBdInfo.Update();
         ScriptManager.RegisterStartupScript(this.Page, this.Page.GetType(), "alert", "alert('" + objMessageInfo.TranMessage + "')", true);
     }
     catch (Exception ex)
     {
         Store.Common.Utility.ExceptionLog.Exceptionlogs(ex.Message, Store.Common.Utility.ExceptionLog.LineNumber(ex), typeof(ItemUnit).FullName, 1);
     }
     finally
     {
         objItemUnit = null;
         //objMessageInfo = null;
         oblItemUnit = null;
     }
 }
Exemple #4
0
 void BindItemUnit()
 {
     oblItemUnit = new Store.ItemUnit.BusinessLogic.ItemUnit();
     try
     {
         obItemUnitList = oblItemUnit.GetAllItemUnitList(0, 0, "");
         if (obItemUnitList != null)
         {
             dgvItemUnit.DataSource = obItemUnitList;
             dgvItemUnit.DataBind();
         }
         else
         {
             dgvItemUnit.DataSource = null;
             dgvItemUnit.DataBind();
         }
     }
     catch (Exception ex)
     {
         Store.Common.Utility.ExceptionLog.Exceptionlogs(ex.Message, Store.Common.Utility.ExceptionLog.LineNumber(ex), typeof(ItemUnit).FullName, 1);
     }
     finally
     {
         oblItemUnit    = null;
         obItemUnitList = null;
     }
 }