Esempio n. 1
0
 protected void btnSave_Click(object sender, EventArgs e)
 {
     lblError.Text      = string.Empty;
     lblError.Visible   = false;
     lblSave.Text       = string.Empty;
     lblSave.Visible    = false;
     lblMessage.Visible = false;
     lblMessage.Text    = string.Empty;
     try
     {
         bool exists = TypeOfPropertyManager.IsExist(txtTypeofProperty.Text.Trim(), Convert.ToInt32(hdId.Value));
         if (exists)
         {
             lblMessage.Text    = "Type Of Property already exists.";
             lblMessage.Visible = true;
             txtTypeofProperty.Focus();
             return;
         }
         TypeOfPropertyMaster obj = TypeOfPropertyManager.GetbyTypeOfPropertyId(Convert.ToInt32(hdId.Value));
         obj.TypeOfProperty = txtTypeofProperty.Text;
         obj.Status         = true;
         TypeOfPropertyManager.Save(obj);
         saveMsg = hdId.Value == "0" ? "Record Saved Successfully." : "Record Updated Successfully.";
         btnCancel_Click(null, null);
         lblSave.Text    = saveMsg;
         lblSave.Visible = true;
     }
     catch (Exception ex)
     {
         lblError.Visible = true;
         lblError.Text    = "Record Not Saved !!!";
     }
 }
Esempio n. 2
0
        private void DoBind()
        {
            List <TypeOfPropertyMaster> lst = TypeOfPropertyManager.GetAll();

            if (lst.Count > 0)
            {
                dvData.Visible    = true;
                PagerRow.Visible  = true;
                lvData.DataSource = lst;
                lvData.DataBind();
            }
            else
            {
                dvData.Visible   = false;
                PagerRow.Visible = false;
            }
        }
Esempio n. 3
0
 protected void lvData_ItemCommand(object sender, ListViewCommandEventArgs e)
 {
     lblError.Text      = string.Empty;
     lblSave.Text       = string.Empty;
     lblMessage.Text    = string.Empty;
     lblMessage.Visible = false;
     lblError.Visible   = false;
     lblSave.Visible    = false;
     if (e.CommandName.Equals("DoEdit"))
     {
         int Id = Convert.ToInt32(e.CommandArgument);
         hdId.Value = Id.ToString();
         Label lblTypeofProperty = (Label)e.Item.FindControl("lblTypeofProperty");
         txtTypeofProperty.Text = lblTypeofProperty.Text;
     }
     else if (e.CommandName.Equals("DoDelete"))
     {
         try
         {
             var list = CheckPrimaryValue.CheckPrimaryValueExists(0, 0, 0, 0, 0, 0, 0, Convert.ToInt32(e.CommandArgument), 0, 0, 0, 0, 0, 0, 0, 0, 0);
             if (list.ToList().Count > 0)
             {
                 lblMessage.Text    = "Type of Property is used so you can't delete !!!";
                 lblMessage.Visible = true;
                 return;
             }
             var dt = TypeOfPropertyManager.GetbyTypeOfPropertyId(Convert.ToInt32(e.CommandArgument));
             dt.Status = false;
             TypeOfPropertyManager.Save(dt);
             DoBind();
             lblSave.Text    = "Record Deleted Successfully.";
             lblSave.Visible = true;
         }
         catch (Exception ex)
         {
             lblError.Text    = "Record Not Deleted.";
             lblError.Visible = true;
         }
     }
 }
Esempio n. 4
0
        protected void bindData()
        {
            var carriers = CarrierManager.GetCarriers(clientID).ToList();

            //LeadPolicyCoverage[] coverages = new LeadPolicyCoverage[5];

            CollectionManager.FillCollection(ddlCarrier, "CarrierID", "CarrierName", carriers);

            var states = State.GetAll();

            CollectionManager.FillCollection(ddlState, "StateId", "StateName", states);

            CollectionManager.FillCollection(ddlInsuredLossState, "StateId", "StateName", states);

            CollectionManager.FillCollection(ddlInsuredMailingState, "StateId", "StateName", states);

            // coverage
            //gvCoverages.DataSource = coverages;
            //gvCoverages.DataBind();

            // property type
            CollectionManager.FillCollection(ddlTypeOfProperty, "TypeOfPropertyId", "TypeOfProperty", TypeOfPropertyManager.GetAll());

            // type of damage
            Fillchk(chkTypeOfDamage, "TypeOfDamageId", "TypeOfDamage", TypeofDamageManager.GetAll());
        }