public HttpResponseMessage Save([FromBody] Designation desig)
 {
     if (desig.ID == 0)
     {
         return(Request.CreateResponse(HttpStatusCode.OK, desig.Save()));
     }
     else
     {
         return(Request.CreateResponse(HttpStatusCode.OK, desig.Update()));
     }
 }
示例#2
0
    private bool SaveData()
    {
        if (!IsValidate())
        {
            return(false);
        }

        string Message = string.Empty;

        var objDesignation = new Designation()
        {
            OrganizationId  = lblOrganizationId.zToInt(),
            DesignationName = txtDesignationName.Text.Trim().zFirstCharToUpper(),
            SerialNo        = txtSerialNo.zToInt(),
            eDesignation    = ddlDesignation.zToInt(),
        };

        if (IsEditMode())
        {
            objDesignation.DesignationId = lblDesignationId.zToInt();
            objDesignation.Update();

            Message = "Designation Detail Change Sucessfully.";
        }
        else
        {
            objDesignation.eStatus = (int)eStatus.Active;
            objDesignation.Insert();

            Message = "New Designation Added Sucessfully.";
        }

        CU.ZMessage(eMsgType.Success, string.Empty, Message);

        return(true);
    }