Пример #1
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;
     }
 }
Пример #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;
            }
        }