Exemplo n.º 1
0
    /// <summary>
    /// this method is used for adding new and updating the information regarding the hosttype which is
    /// called on clicking save button.
    /// </summary>
    private void UpdateHostType()
    {
        //FranchisorService service = new FranchisorService();
        //HealthYes.Web.UI.FranchisorService.EProspectType hosttype = new HealthYes.Web.UI.FranchisorService.EProspectType();
        FranchisorDAL objFranchisorDal = new FranchisorDAL();
        var           hosttype         = new Falcon.Entity.Other.EProspectType();

        hosttype.Description = txtDescription.Text;
        hosttype.Name        = txtName.Text;

        hosttype.Active = true;
        Int64 returnresult;

        if (hfHostTypeID.Value.ToString().Equals(""))
        {
            //service.AddProspectType(hosttype , usershellmodulerole1, out returnresult, out temp);
            returnresult = objFranchisorDal.SaveProspectType(hosttype, Convert.ToInt32(EOperationMode.Insert));
        }
        else
        {
            hosttype.ProspectTypeID = Convert.ToInt32(((DataTable)(ViewState["DSGRID"])).Rows[grdHostType.Rows[Convert.ToInt32(hfHostTypeID.Value)].DataItemIndex]["HostTypeID"]);
            //service.UpdateProspectType(hosttype, usershellmodulerole1, out returnresult, out temp);
            returnresult = objFranchisorDal.SaveProspectType(hosttype, Convert.ToInt32(EOperationMode.Update));
        }
        divErrorMsg.Visible   = true;
        divErrorMsg.InnerHtml = (String)GetGlobalResourceObject("Resource", "msgDatabaseResult" + returnresult.ToString());
        hfHostTypeID.Value    = "";
        GetHostType();
    }
Exemplo n.º 2
0
    /// <summary>
    /// this method is used for deactivating the selected HostType(s).
    /// </summary>
    /// <param name="sender"></param>
    /// <param name="e"></param>
    protected void btnDeActivate_Click(object sender, ImageClickEventArgs e)
    {
        Int64 returnresult;
        var   hostTypeIds = GetSelectedHostType();

        if (hostTypeIds.Length > 0)
        {
            var objFranchisorDal = new FranchisorDAL();
            returnresult          = objFranchisorDal.SaveProspectType(hostTypeIds, Convert.ToInt32(EOperationMode.DeActivate));
            divErrorMsg.Visible   = true;
            divErrorMsg.InnerHtml = (String)GetGlobalResourceObject("Resource", "msgDatabaseResult" + returnresult.ToString());
            hfHostTypeID.Value    = "";
            GetHostType();
        }
    }