public ActionResult UpdateEidtFunction()
 {
     try
     {
         int groupId = 0;
         bool flag = false;
         FunctionGroup functionGroup = new FunctionGroup();
         if (!string.IsNullOrEmpty(Request.Form["GroupId"]))
         {
             groupId = Convert.ToInt32(Request.Form["GroupId"]);
         }
         if (!string.IsNullOrEmpty(Request.Form["rowID"]))
         {
             string[] rowId = Request.Form["rowID"].Split(new char[] { '|' }, StringSplitOptions.RemoveEmptyEntries);
             functionGroupMgr = new FunctionGroupMgr(connectionString);
             flag = functionGroupMgr.UpdateEditFunction(rowId, groupId);
         }
         return Json(new { success = flag });
     }
     catch (Exception ex)
     {
         Log4NetCustom.LogMessage logMessage = new Log4NetCustom.LogMessage();
         logMessage.Content = string.Format("TargetSite:{0},Source:{1},Message:{2}", ex.TargetSite.Name, ex.Source, ex.Message);
         logMessage.MethodName = System.Reflection.MethodBase.GetCurrentMethod().Name;
         log.Error(logMessage);
         return Json(new { success = false });
     }
 }
        public HttpResponseBase SaveAuthority()
        {
            string json = string.Empty;
            try
            {
                FunctionGroup functionGroup = new FunctionGroup();
                BLL.gigade.Model.Vendor vendorModel = (BLL.gigade.Model.Vendor)Session["vendor"];

                string callId = vendorModel.vendor_email;
                functionGroup.Kuser = callId;
                if (!string.IsNullOrEmpty(Request.Form["GroupId"]))
                {
                    functionGroup.GroupId = Convert.ToInt32(Request.Form["GroupId"]);
                }
                if (!string.IsNullOrEmpty(Request.Form["rowID"]))
                {
                    string[] rowId = Request.Form["rowID"].Split('|');

                    functionGroupMgr = new FunctionVGroupMgr(connectionString);
                    functionGroupMgr.Delete(functionGroup.GroupId);
                    {
                        foreach (var str in rowId)
                        {
                            if (!string.IsNullOrEmpty(str))
                            {
                                functionGroup.FunctionId = Convert.ToInt32(str);
                                functionGroupMgr.Save(functionGroup);
                            }
                        }
                    }
                }
                json = "{success:true}";
            }
            catch (Exception ex)
            {
                json = "{success:false}";
                Log4NetCustom.LogMessage logMessage = new Log4NetCustom.LogMessage();
                logMessage.Content = string.Format("TargetSite:{0},Source:{1},Message:{2}", ex.TargetSite.Name, ex.Source, ex.Message);
                logMessage.MethodName = System.Reflection.MethodBase.GetCurrentMethod().Name;
                log.Error(logMessage);
            }
            this.Response.Clear();
            this.Response.Write(json);
            this.Response.End();
            return this.Response;
        }