Exemplo n.º 1
0
 protected void IMGBTNcategoryisActive_Click(object sender, ImageClickEventArgs e)
 {
     ImageButton lnk = (ImageButton)sender;
     int userid = Convert.ToInt32(lnk.CommandArgument);
     objprodctg = null;
     objprodctg = ObjprodClass.GetProdmedicineByID(userid);
     if (objprodctg != null)
     {
         if (objprodctg.IsActive == true)
             ChkIsActivemedicine.Checked = true;
         TXTmedicine.Text = objprodctg.Name;
         errorpopupmedicine.Style.Add("display", "none");
         DIVIsActive.Style.Add("display", "block");
         btnSubmitmedicine.Text = "Update";
         ViewState["popupID"] = userid.ToString();
         ScriptManager.RegisterStartupScript(this, typeof(Page), "aa", "jQuery(document).ready(function(){ShowPOPUPmedicineUpdate('true');});", true);
     }
 }
Exemplo n.º 2
0
    protected void grdprod_RowDataBound(object sender, GridViewRowEventArgs e)
    {
        if (e.Row.RowType == DataControlRowType.DataRow && e.Row.DataItem != null)
        {
            try
            {
                GridViewRow gr = e.Row;
                Label lblprodname = (Label)gr.FindControl("lblProdname");
                Label lblProdctg = (Label)gr.FindControl("lblProdctg");
                Label lblProdcomp = (Label)gr.FindControl("lblProdcomp");
                Label lblProdtype = (Label)gr.FindControl("lblProdtype");
                Label lblProdsupp = (Label)gr.FindControl("lblProdsupp");
                Label lblProdmedicinefor = (Label)gr.FindControl("lblProdmedicinefor");
                Label lblProdPcost = (Label)gr.FindControl("lblProdPcost");
                Label lblProdScost = (Label)gr.FindControl("lblProdScost");
                Label lblProdoffer = (Label)gr.FindControl("lblProdoffer");
                HiddenField HDFID = (HiddenField)gr.FindControl("HDFProdID");
                ImageButton IMGBTNcategoryisActive = (ImageButton)gr.FindControl("IMGBTNProdisActive");
                Image IMGProd = (Image)gr.FindControl("IMGProd");
                ProdTable u = e.Row.DataItem as ProdTable;
                objitem = null;
                objitem = ObjprodClass.GetItemsByID(Convert.ToInt32(u.ItemId));
                if (objitem != null)
                {
                    objitempurchase = ObjprodClass.GetItempurchaseByID(Convert.ToInt32(u.PurchaseId));
                    objitemsell = ObjprodClass.GetItemsellByID(Convert.ToInt32(u.SellId));
                    objprodctg = ObjprodClass.GetProdSubcategoryByID(Convert.ToInt32(u.CategoryId));
                    objprodtype = ObjprodClass.GetProdTypeByID(Convert.ToInt32(u.TypeId));
                    objprodsupple = ObjprodClass.GetProdsupplymentByID(Convert.ToInt32(u.SupplementId));
                    Objprodcomp = ObjprodClass.GetProdcompByID(Convert.ToInt32(u.CompanyId));
                    objmed = ObjprodClass.GetProdmedicineByID(Convert.ToInt32(u.MedicineForId));
                    objoffer = ObjprodClass.GetProdOfferByID(Convert.ToInt32(u.OfferId));
                    if (objitempurchase != null && objitemsell != null & objprodctg != null
                        && objprodtype != null & objprodsupple != null && Objprodcomp != null
                        & objmed != null && objoffer != null)
                    {
                        lblprodname.Text = objitem.ItemName.ToString().Trim();
                        lblProdctg.Text = objprodctg.SubCategoryName.ToString().Trim();
                        lblProdtype.Text = objprodtype.Name.ToString().Trim();
                        lblProdsupp.Text = objprodsupple.Name.ToString().Trim();
                        lblProdcomp.Text = Objprodcomp.CompanyName.ToString().Trim();
                        lblProdmedicinefor.Text = objmed.Name.ToString().Trim();
                        lblProdoffer.Text = objoffer.OfferPercent.ToString().Trim();
                        lblProdPcost.Text = objitempurchase.Cost.ToString().Trim();
                        lblProdScost.Text = objitemsell.Cost.ToString().Trim();
                        HDFID.Value = u.Id.ToString();
                        IMGProd.ImageUrl = u.ImageUrl;

                        if (u.IsActive == true)
                        {
                            IMGBTNcategoryisActive.ImageUrl = "~/images/tick.png";
                        }
                        else
                            IMGBTNcategoryisActive.ImageUrl = "~/images/close.jpg";
                    }
                }
            }
            catch (Exception ex)
            {
                Response.Write(ex.ToString());
            }
        }
    }
Exemplo n.º 3
0
 public ProdMedicineFor GetProdmedicineByID(int id)
 {
     objprodmedicine = null;
     objprodmedicine = DataRepository.ProdMedicineForProvider.GetById(id);
     return objprodmedicine;
 }
Exemplo n.º 4
0
 public string UpdateProdMedicine(ProdMedicineFor orduser)
 {
     TransactionManager transaction = null;
     try
     {
         transaction = DataRepository.Provider.CreateTransaction();
         transaction.BeginTransaction();
         if (DataRepository.ProdMedicineForProvider.Update(orduser))
         {
             // Show proper message
         }
         else
         {
             return "Information could not be saved.";
         }
         transaction.Commit();
         return "Information Update successfully.";
     }
     catch (Exception e)
     {
         transaction.Rollback();
         return "Information could not be saved.Please contact Administrator.";
     }
 }
Exemplo n.º 5
0
    protected void btnSubmit_Click1(object sender, EventArgs e)
    {
        string categoryname = TXTmedicine.Text;
        if (categoryname != null)
        {
            objprodctg.Name = categoryname.ToString();
            objprodctg.CreatedDate = DateTime.Now;
            switch (btnSubmitmedicine.Text.Trim())
            {
                case "Submit":
                    ViewState["popupID"] = null;
                    Status = ObjprodClass.insertProdmedicinefor(objprodctg);
                    if (Status == "Information Insert successfully.")
                    {
                        errorpopupmedicine.Visible = true;
                        errorpopupmedicine.Style.Add("display", "block");
                        errorpopupmedicine.Attributes.Add("class", "fk-msg-success");
                        errorpopupmedicine.InnerHtml = "ProductMedicine Inserted successfully";
                        BindProdCategoryGrid();
                        ScriptManager.RegisterStartupScript(this, typeof(Page), "aa", "jQuery(document).ready(function(){ShowPOPUPmedicine('true');});", true);
                    }
                    else
                    {
                        errorpopupmedicine.Visible = true;
                        errorpopupmedicine.Style.Add("display", "block");
                        errorpopupmedicine.Attributes.Add("class", "fk-err-all");
                        errorpopupmedicine.InnerHtml = Status;
                        ScriptManager.RegisterStartupScript(this, typeof(Page), "aa", "jQuery(document).ready(function(){ShowPOPUPmedicine('true');});", true);
                    }
                    break;
                case "Update":
                    if (ViewState["popupID"] != null && ViewState["popupID"] != "")
                    {
                        objprodctg = null;
                        objprodctg = ObjprodClass.GetProdmedicineByID(Convert.ToInt32(ViewState["popupID"]));
                        objprodctg.Name = categoryname.ToString();
                        if (ChkIsActivemedicine.Checked)
                            objprodctg.IsActive = true;
                        else
                            objprodctg.IsActive = false;
                        Status = ObjprodClass.UpdateProdMedicine(objprodctg);
                        if (Status == "Information Update successfully.")
                        {
                            errorpopupmedicine.Visible = true;
                            errorpopupmedicine.Style.Add("display", "block");
                            errorpopupmedicine.Attributes.Add("class", "fk-msg-success");
                            errorpopupmedicine.InnerHtml = "Productmedicine Updated successfully";
                            BindProdCategoryGrid();
                            ScriptManager.RegisterStartupScript(this, typeof(Page), "aa", "jQuery(document).ready(function(){ShowPOPUPmedicineUpdate('true');});", true);
                        }
                        else
                        {
                            errorpopupmedicine.Visible = true;
                            errorpopupmedicine.Style.Add("display", "block");
                            errorpopupmedicine.Attributes.Add("class", "fk-err-all");
                            errorpopupmedicine.InnerHtml = Status;
                            ScriptManager.RegisterStartupScript(this, typeof(Page), "aa", "jQuery(document).ready(function(){ShowPOPUPmedicineUpdate('true');});", true);
                        }
                    }
                    break;
            }


        }
    }