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

        scripttype.Description = txtDescription.Text;
        scripttype.ScriptName  = txtName.Text;

        scripttype.Active = true;
        Int64 returnresult;

        CallCenterDAL callCenterDal = new CallCenterDAL();

        if (hfScriptTypeID.Value.Equals(""))
        {
            returnresult = callCenterDal.SaveScriptType(scripttype, Convert.ToInt32(EOperationMode.Insert));
            if (returnresult == 0)
            {
                returnresult = 9999990;
            }
        }
        else
        {
            scripttype.ScriptTypeID = Convert.ToInt32(((DataTable)(ViewState["DSGRID"])).Rows[grdScriptType.Rows[Convert.ToInt32(hfScriptTypeID.Value)].DataItemIndex]["ScriptTypeID"]);
            returnresult            = callCenterDal.SaveScriptType(scripttype, Convert.ToInt32(EOperationMode.Update));
            if (returnresult == 0)
            {
                returnresult = 9999991;
            }
        }
        errordiv.Visible     = true;
        errordiv.InnerHtml   = (String)GetGlobalResourceObject("Resource", "msgDatabaseResult" + returnresult.ToString());
        hfScriptTypeID.Value = "";
        GetScriptType();
    }
Exemplo n.º 2
0
    /// <summary>
    /// this method is used for activating the selected ScriptType(s).
    /// </summary>
    /// <param name="sender"></param>
    /// <param name="e"></param>
    protected void btnActivate_Click(object sender, ImageClickEventArgs e)
    {
        string strSelectedScriptTypeIDs = GetSelectedScriptTypeIDs();

        if (strSelectedScriptTypeIDs.Length > 0)
        {
            CallCenterDAL callCenterDal = new CallCenterDAL();
            Int64         returnresult  = callCenterDal.SaveScriptType(strSelectedScriptTypeIDs,
                                                                       Convert.ToInt32(EOperationMode.Activate));
            if (returnresult == 0)
            {
                returnresult = 9999994;
            }

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