예제 #1
0
 public ActionResult Create(FormCollection collection)
 {
     try
     {
         // TODO: Add insert logic here
         var model = new Designation();
         TryUpdateModel(model);
         model.Insert();
         return(RedirectToAction("Index"));
     }
     catch
     {
         return(View());
     }
 }
예제 #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);
    }