public JsonResult InsMemberStore(MemberStoreModel memberStore) { Result data = null; try { strLoginID = HttpContext.Session.GetString("loginid"); data = new Result(); string spName = "UP_MEMBER_STORE_TX_INS"; string[] spParamName = new string[] { "@pi_strMemberStoreName", "@pi_strCEOName", "@pi_strLicenseNo", "@pi_intUseType", "@pi_intProvideType", "@pi_intProvideCycle", "@pi_intLastProvideYMD", "@pi_strExpireFlag", "@pi_intExpireCycle", "@pi_intLastExpireYMD", "@pi_strAdminID", "@po_intRetVal", "@po_strErrMsg" }; object[] spParamValue = new object[] { memberStore.MemberStoreName, memberStore.CEOName, memberStore.LicenseNo, memberStore.UseType, memberStore.ProvideType, memberStore.ProvideCycle, DBNull.Value, DBNull.Value, memberStore.ExpireCycle, DBNull.Value, strLoginID, DBNull.Value, DBNull.Value, }; data = dbConn.SqlExecuteSPReturnValue(spName, spParamName, spParamValue); } catch (Exception ex) { data.RetVal = 990; data.ErrMsg = "Exception in InsMemberStore : " + ex.Message; return(Json(data)); } return(Json(new { data })); }
public JsonResult UpdMemberStore(MemberStoreModel memberStore) { Result data = null; try { data = new Result(); string spName = "UP_MEMBER_STORE_TX_UPD"; string[] spParamName = new string[] { "@pi_intMemberStoreNo", "@pi_strMemberStoreName", "@pi_strCEOName", "@pi_strLicenseNo", "@pi_intUseType", "@pi_intProvideType", "@pi_intProvideCycle", "@pi_strLastProvideYMD", "@pi_strExpireFlag", "@pi_intExpireCycle", "@pi_strLastExpireYMD", "@pi_intUseState", "@po_intRetVal", "@po_strErrMsg" }; object[] spParamValue = new object[] { memberStore.MemberStoreNo, memberStore.MemberStoreName, memberStore.CEOName, memberStore.LicenseNo, memberStore.UseType, memberStore.ProvideType, memberStore.ProvideCycle, DBNull.Value, DBNull.Value, memberStore.ExpireCycle, DBNull.Value, memberStore.UseState, DBNull.Value, DBNull.Value, }; data = dbConn.SqlExecuteSPReturnValue(spName, spParamName, spParamValue); } catch (Exception ex) { data.RetVal = 980; data.ErrMsg = "Exception in UpdMemberStore : " + ex.Message; return(Json(data)); } return(Json(new { data })); }
public JsonResult DetailMemberStore(MemberStoreModel memberStore) { Result <MemberStoreModel> data = null; try { data = new Result <MemberStoreModel>(); string spName = "UP_MEMBER_STORE_AR_LST"; string[] spParamName = new string[] { "@pi_intMemberStoreNo", "@pi_strMemberStoreName", "@pi_strCEOName", "@pi_strLicenseNo", "@pi_intUseType", "@pi_intProvideType", "@pi_intProvideCycle", "@pi_intLastProvideYMD", "@pi_intExpireFlag", "@pi_intExpireCycle", "@pi_intLastExpireYMD", "@pi_intUseState" }; object[] spParamValue = new object[] { memberStore.MemberStoreNo, DBNull.Value, DBNull.Value, DBNull.Value, memberStore.UseState, DBNull.Value, DBNull.Value, DBNull.Value, DBNull.Value, DBNull.Value, DBNull.Value, DBNull.Value }; Result <DataTable> result = dbConn.SqlExecuteSPReturnTable(spName, spParamName, spParamValue); if (result.RetVal.Equals(0)) { foreach (DataRow row in result.data.Rows) { data.data = new MemberStoreModel { MemberStoreNo = Convert.ToInt64(row["MEMBERSTORENO"]), MemberStoreName = row["MEMBERSTORENAME"].ToString() ?? "", UseType = Convert.ToInt16(row["USETYPE"]), ProvideType = Convert.ToInt16(row["PROVIDETYPE"]), ProvideCycle = Convert.ToInt16(row["PROVIDECYCLE"]), LastProvideYMD = row["LASTPROVIDEYMD"].ToString() ?? "", ExpireFlag = row["EXPIREFLAG"].ToString(), ExpireCycle = Convert.ToInt16(row["EXPIRECYCLE"]), LastExpireYMD = row["LASTEXPIREYMD"].ToString() ?? "", UseState = Convert.ToInt16(row["USESTATE"]), AdminID = row["ADMINID"].ToString(), RegDate = row["REGDATE"].ToString(), UpdDate = row["UPDDATE"].ToString() ?? "", CEOName = row["CEONAME"].ToString(), LicenseNo = row["LICENSENO"].ToString() }; } } } catch (Exception ex) { data.RetVal = 999; data.ErrMsg = "Exception in DetailMemberStore : " + ex.Message; return(Json(data)); } return(Json(new { data })); }
public JsonResult GetMemberSalesContractList(MemberStoreModel memberStore) { List <MemberStoreModel> data = new List <MemberStoreModel>(); try { string spName = "UP_MEMBER_STORE_AR_LST"; string[] spParamName = new string[] { "@pi_intMemberStoreNo", "@pi_strMemberStoreName", "@pi_strCEOName", "@pi_strLicenseNo", "@pi_intUseType", "@pi_intProvideType", "@pi_intProvideCycle", "@pi_intLastProvideYMD", "@pi_intExpireFlag", "@pi_intExpireCycle", "@pi_intLastExpireYMD", "@pi_intUseState" }; object[] spParamValue = new object[] { memberStore.MemberStoreNo, DBNull.Value, DBNull.Value, DBNull.Value, DBNull.Value, DBNull.Value, DBNull.Value, DBNull.Value, DBNull.Value, DBNull.Value, DBNull.Value, memberStore.UseState }; Result <DataTable> result = dbConn.SqlExecuteSPReturnTable(spName, spParamName, spParamValue); if (result.RetVal.Equals(0)) { foreach (DataRow row in result.data.Rows) { MemberStoreModel obj = new MemberStoreModel { MemberStoreNo = Convert.ToInt64(row["MEMBERSTORENO"]), MemberStoreName = row["MEMBERSTORENAME"].ToString(), UseState = Convert.ToInt16(row["USESTATE"]), RegDate = row["REGDATE"].ToString(), UpdDate = row["UPDDATE"].ToString() }; data.Add(obj); } } } catch (Exception ex) { Console.WriteLine("Exception in GetMemberSalesContractList : " + ex.Message); return(Json(data)); } return(Json(new { data })); }