Exemplo n.º 1
0
    /// <summary>
    /// this method is used for adding new and updating the information regarding the MVUserSpecialization which is
    /// called on clicking save button.
    /// </summary>
    private void UpdateMVUserSpecialization()
    {
        EMVUserSpecialization mvuserspecialization = new EMVUserSpecialization();

        mvuserspecialization.Description = txtDescription.Text;
        mvuserspecialization.Name        = txtName.Text;
        mvuserspecialization.Active      = true;
        Int64 returnresult;

        MedicalVendorDAL medicalVendorDal = new MedicalVendorDAL();

        if (hfMVUserSpecializationID.Value.ToString().Equals(""))
        {
            returnresult = medicalVendorDal.SaveMVUserSpecialization(mvuserspecialization,
                                                                     Convert.ToInt32(EOperationMode.Insert));
            if (returnresult == 0)
            {
                returnresult = 9999990;
            }
        }
        else
        {
            mvuserspecialization.MVUserSpecilaizationID = Convert.ToInt32(((DataTable)(ViewState["DSGRID"])).Rows[grdMVUserSpecialization.Rows[Convert.ToInt32(hfMVUserSpecializationID.Value)].DataItemIndex]["MVUserSpecializationID"]);

            returnresult = medicalVendorDal.SaveMVUserSpecialization(mvuserspecialization,
                                                                     Convert.ToInt32(EOperationMode.Update));
            if (returnresult == 0)
            {
                returnresult = 9999991;
            }
        }
        errordiv.InnerHtml             = (String)GetGlobalResourceObject("Resource", "msgDatabaseResult" + returnresult.ToString());
        errordiv.Visible               = true;
        hfMVUserSpecializationID.Value = "";
        GetMVUserSpecialization();
    }
Exemplo n.º 2
0
    /// <summary>
    /// this method is used for deactivating the selected MVUserSpecialization(s).
    /// </summary>
    /// <param name="sender"></param>
    /// <param name="e"></param>
    protected void btnDeActivate_Click(object sender, ImageClickEventArgs e)
    {
        Int64 returnresult;

        string strSelectedMVUserSpecializationIDs = GetSelectedMVUserSpecializationIDs();

        if (strSelectedMVUserSpecializationIDs.Length > 0)
        {
            MedicalVendorDAL medicalvendorDAL = new MedicalVendorDAL();
            returnresult = medicalvendorDAL.SaveMVUserSpecialization(strSelectedMVUserSpecializationIDs,
                                                                     Convert.ToInt32(EOperationMode.DeActivate));
            if (returnresult == 0)
            {
                returnresult = 9999993;
            }

            errordiv.InnerHtml             = (String)GetGlobalResourceObject("Resource", "msgDatabaseResult" + returnresult.ToString());
            errordiv.Visible               = true;
            hfMVUserSpecializationID.Value = "";
            GetMVUserSpecialization();
        }
    }