Example #1
0
    protected void BtnUpdate_Click(object sender, EventArgs e)
    {
        int UpdateRow = 0;

        try
        {
            if (ViewState["EditID"] != null)
            {
                Entity_ItemCategory.SizeId = Convert.ToInt32(ViewState["EditID"]);
            }
            Entity_ItemCategory.SizeName = TxtItemCat.Text.Trim();

            Entity_ItemCategory.UserId    = Convert.ToInt32(Session["UserId"]);
            Entity_ItemCategory.LoginDate = DateTime.Now;

            UpdateRow = Obj_ItemCategory.UpdateRecord(ref Entity_ItemCategory, out StrError);

            if (UpdateRow != 0)
            {
                obj_Comman.ShowPopUpMsg("Record Updated Successfully", this.Page);
                MakeEmptyForm();
                Entity_ItemCategory = null;
                Obj_ItemCategory    = null;
            }
        }
        catch (Exception ex)
        {
            throw new Exception(ex.Message);
        }
    }
Example #2
0
    protected void BtnDelete_Click(object sender, EventArgs e)
    {
        try
        {
            int DeleteId = 0;
            if (ViewState["EditID"] != null)
            {
                DeleteId = Convert.ToInt32(ViewState["EditID"]);
            }
            if (DeleteId != 0)
            {
                Entity_ItemCategory.SizeId    = DeleteId;
                Entity_ItemCategory.UserId    = Convert.ToInt32(Session["UserID"]);
                Entity_ItemCategory.LoginDate = DateTime.Now;

                int iDelete = Obj_ItemCategory.DeleteRecord(ref Entity_ItemCategory, out StrError);
                if (iDelete != 0)
                {
                    obj_Comman.ShowPopUpMsg("Record Deleted Successfully..!", this.Page);
                    MakeEmptyForm();
                }
            }
            Entity_ItemCategory = null;
            Obj_ItemCategory    = null;
        }
        catch (Exception ex) { throw new Exception(ex.Message); }
    }
Example #3
0
    protected void BtnSave_Click(object sender, EventArgs e)
    {
        int InsertRow = 0;

        try
        {
            Ds = Obj_ItemCategory.ChkDuplicate(TxtItemCat.Text.Trim(), out StrError);
            if (Ds.Tables[0].Rows.Count > 0)
            {
                obj_Comman.ShowPopUpMsg("Please Enter Another Item Category..", this.Page);
                TxtItemCat.Focus();
            }
            else
            {
                Entity_ItemCategory.SizeName = TxtItemCat.Text.Trim();

                Entity_ItemCategory.UserId    = Convert.ToInt32(Session["UserId"]);
                Entity_ItemCategory.LoginDate = DateTime.Now;

                InsertRow = Obj_ItemCategory.InsertRecord(ref Entity_ItemCategory, out StrError);

                if (InsertRow != 0)
                {
                    obj_Comman.ShowPopUpMsg("Record Saved Successfully", this.Page);
                    MakeEmptyForm();
                    Entity_ItemCategory = null;
                    Obj_ItemCategory    = null;
                }
            }
        }
        catch (Exception ex) { throw new Exception(ex.Message); }
    }
Example #4
0
 public void ReportGrid(string RepCondition)
 {
     try
     {
         Ds = Obj_ItemCategory.GetItemSize(RepCondition, out StrError);
         if (Ds.Tables.Count > 0 && Ds.Tables[0].Rows.Count > 0)
         {
             GrdReport.DataSource = Ds.Tables[0];
             GrdReport.DataBind();
         }
         else
         {
             GrdReport.DataSource = null;
             GrdReport.DataBind();
         }
         Obj_ItemCategory = null;
         Ds = null;
     }
     catch (Exception ex) { throw new Exception(ex.Message); }
 }
Example #5
0
 protected void GrdReport_ItemCommand(object source, RepeaterCommandEventArgs e)
 {
     try
     {
         switch (e.CommandName)
         {
         case ("Select"):
         {
             if (Convert.ToInt32(e.CommandArgument) != 0)
             {
                 ViewState["EditID"] = Convert.ToInt32(e.CommandArgument);
                 Ds = Obj_ItemCategory.GetItemSizeForEdit(Convert.ToInt32(e.CommandArgument), out StrError);
                 if (Ds.Tables.Count > 0 && Ds.Tables[0].Rows.Count > 0)
                 {
                     TxtItemCat.Text = Ds.Tables[0].Rows[0]["SizeName"].ToString();
                 }
                 else
                 {
                     MakeEmptyForm();
                 }
                 Ds = null;
                 Obj_ItemCategory = null;
                 if (!FlagEdit)
                 {
                     BtnUpdate.Visible = true;
                 }
                 BtnSave.Visible = false;
                 if (!FlagDel)
                 {
                     BtnDelete.Visible = true;
                 }
                 TxtItemCat.Focus();
             }
             break;
         }
         }
     }
     catch (Exception ex) { throw new Exception(ex.Message); }
 }