/// <summary> /// Get the depending user details for user master insert or update /// </summary> //public JsonResult GetUserMasterDetails() //{ // try // { // DataSet ds = new DataSet(); // DataControl.Data _objData = new DataControl.Data(); // _objData.OpenConnection(_objcurrentInfo.GetCompanyCode()); // { // string strQry = "exec SP_hd_User_Type_Select '" + _objcurrentInfo.GetCompanyCode() + "';"; // strQry += "exec SP_hdGetEmployee '" + _objcurrentInfo.GetCompanyCode() + "';"; // strQry += "exec SP_hdGetUsers '" + _objcurrentInfo.GetCompanyCode() + "';"; // strQry += "exec SP_hdGetDivisions '" + _objcurrentInfo.GetCompanyCode() + "';"; // strQry += "exec SP_hdGetRegion '" + _objcurrentInfo.GetCompanyCode() + "';"; // strQry += "exec SP_hdGetDoctorCategory '" + _objcurrentInfo.GetCompanyCode() + "';"; // strQry += "exec SP_hdGetExpenseGroup '" + _objcurrentInfo.GetCompanyCode() + "'"; // ds = _objData.ExecuteDataSet(strQry); // } // DataControl.JSONConverter json = new DataControl.JSONConverter(); // return Json(json.Serialize(ds), JsonRequestBehavior.AllowGet); // } // finally // { // _objData.CloseConnection(); // } //} /// <summary> /// User master insert and update /// </summary> //[HttpPost] //public string insertUser(FormCollection collection) //{ // try // { // // TODO: Add insert logic here // string result = ""; // //string hidoctorStartDate = collection["HiDOCTOR_Start_Date"].ToString(); // string hidoctorStartDate = ""; // if (!string.IsNullOrEmpty(collection["HiDOCTORStartDate"].ToString())) // { // hidoctorStartDate = collection["HiDOCTORStartDate"].ToString().Split('/')[1] + "/" + collection["HiDOCTORStartDate"].ToString().Split('/')[0] + "/" + collection["HiDOCTORStartDate"].ToString().Split('/')[2]; // } // else // { // hidoctorStartDate = DateTime.Now.ToString("yyyy-MM-dd"); // } // if (collection["UserCode"].ToString() == "") // { // string userCode = _objData.GetMaxCode(_objcurrentInfo.GetCompanyCode(), "tbl_SFA_User_Master", "User_Code", "USC"); // //result = _objSPData.InsertUserMaster(_objcurrentInfo.GetCompanyCode(), userCode, collection["EmployeeCode"].ToString(), collection["UserTypeCode"].ToString(), // // collection["UnderUserCode"], collection["UserName"].ToString(), collection["UserPass"].ToString(), // // collection["Status"].ToString(), collection["RegionCode"].ToString(), collection["UserDivisionCode"].ToString(), // // collection["UserCategoryCode"].ToString(), collection["ExpenseEligibilityRegion"].ToString(), collection["ExpenseGroupId"].ToString(), // // Convert.ToDateTime(hidoctorStartDate).ToString("yyyy-MM-dd"), ""); // } // else // { // result = _objSPData.UpdateUserMaster(_objcurrentInfo.GetCompanyCode(), collection["UserCode"].ToString(), collection["EmployeeCode"].ToString(), collection["UserTypeCode"].ToString(), // collection["UnderUserCode"], collection["UserName"].ToString(), collection["UserPass"].ToString(), // collection["Status"].ToString(), collection["RegionCode"].ToString(), collection["UserDivisionCode"].ToString(), // collection["UserCategoryCode"].ToString(), collection["ExpenseEligibilityRegion"].ToString(), collection["ExpenseGroupId"].ToString(), // Convert.ToDateTime(hidoctorStartDate).ToString("yyyy-MM-dd"), ""); // } // return result; // } // catch (Exception ex) // { // ErrorLog.LogError(ex, "insertUser()"); // return ""; // } //} ///// <summary> ///// Get selected user details ///// </summary> //public JsonResult GetSelectedUserDetails(FormCollection collection) //{ // try // { // DataSet ds = new DataSet(); // DataControl.Data _objData = new DataControl.Data(); // _objData.OpenConnection(_objcurrentInfo.GetCompanyCode()); // { // ds = _objData.ExecuteDataSet("EXEC SP_hdGetSelectedUser '" + _objcurrentInfo.GetCompanyCode() + "','" + collection["UserCode"].ToString() + "'"); // } // DataControl.JSONConverter json = new DataControl.JSONConverter(); // return Json(json.Serialize(ds), JsonRequestBehavior.AllowGet); // } // finally // { // _objData.CloseConnection(); // } //} /// <summary> /// Update region master seq_index column while change the parent region using drag and drop /// </summary> public string UpdateRegionSeq(FormCollection collection) { string result = ""; try { // TODO: Add insert logic here result = _objSPData.UpdateRegionSeqIndex(_objcurrentInfo.GetCompanyCode(), collection["Node"].ToString(), collection["SourceNode"].ToString(), collection["HitMode"].ToString()); return(result); } catch (Exception ex) { ErrorLog.LogError(ex, "UpdateRegionSeq()"); return(""); } }