Пример #1
0
    /// <summary>
    /// this method is used for deactivating the selected MVUserClassification(s).
    /// </summary>
    /// <param name="sender"></param>
    /// <param name="e"></param>
    protected void btnDeActivate_Click(object sender, ImageClickEventArgs e)
    {
        Int64 returnresult;

        string strSelectedMVUserclassificationIDs = GetSelectedMVUserClassification();



        //if (MVUserClassifications.Length > 0)
        if (strSelectedMVUserclassificationIDs.Length > 0)
        {
            MedicalVendorDAL medicalVendorDal = new MedicalVendorDAL();

            returnresult = medicalVendorDal.SaveMVUserClassification(strSelectedMVUserclassificationIDs,
                                                                     Convert.ToInt32(EOperationMode.DeActivate));
            if (returnresult == 0)
            {
                returnresult = 9999993;
            }
            errordiv.InnerHtml             = (String)GetGlobalResourceObject("Resource", "msgDatabaseResult" + returnresult.ToString());
            errordiv.Visible               = true;
            hfMVUserClassificationID.Value = "";
            GetMVUserClassification();
        }
    }
Пример #2
0
    /// <summary>
    /// this method is used for adding new and updating the information regarding the MVUserClassification which is
    /// called on clicking save button.
    /// </summary>
    private void UpdateMVUserClassification()
    {
        EMVUserClassification mvuserclassification = new EMVUserClassification();

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

        mvuserclassification.Active = true;
        Int64 returnresult;

        MedicalVendorDAL medicalVendorDal = new MedicalVendorDAL();

        if (hfMVUserClassificationID.Value.ToString().Equals(""))
        {
            returnresult = medicalVendorDal.SaveMVUserClassification(mvuserclassification,
                                                                     Convert.ToInt32(EOperationMode.Insert));
            if (returnresult == 0)
            {
                returnresult = 9999990;
            }
        }
        else
        {
            mvuserclassification.MVUserClassificationID = Convert.ToInt32(((DataTable)(ViewState["DSGRID"])).Rows[grdMVUserClassification.Rows[Convert.ToInt32(hfMVUserClassificationID.Value)].DataItemIndex]["MVUserClassificationID"]);

            returnresult = medicalVendorDal.SaveMVUserClassification(mvuserclassification,
                                                                     Convert.ToInt32(EOperationMode.Update));

            if (returnresult == 0)
            {
                returnresult = 9999991;
            }
        }

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