public string sDbNm(string pMemcoCd) { string reVal = ""; DbSysSysCode db = null; try { db = new DbSysSysCode(); reVal = db.sDbNm(pMemcoCd); } catch (Exception ex) { logs.SaveLog("[error] (page)::BizSystem.cs (Function)::sSiteMenu (Detail)::pMemcoCd=[" + pMemcoCd + "]", "Error"); logs.SaveLog("[error] (page)::BizSystem.cs (Function)::sSiteMenu (Detail)::" + "\r\n" + ex.ToString(), "Error"); } finally { if (db != null) { db.DisConnect(); } } return(reVal); }
public DataSet psSysCodeGrp(string pScodeGrp) { DataSet ds = null; DbPractice db = null; try { db = new DbPractice(); ds = db.psSysCodeGrp(pScodeGrp); } catch (Exception ex) { logs.SaveLog("[error] (page)::BizSysCodeGrp.cs (Function)::sSysCodeGrp (Detail)::pScodeGrp=[" + pScodeGrp + "]", "Error"); logs.SaveLog("[error] (page)::BizSysCodeGrp.cs (Function)::sSysCodeGrp (Detail)::" + "\r\n" + ex.ToString(), "Error"); } finally { if (db != null) { db.DisConnect(); } } return(ds); }
//TreeView public DataSet sMember_UsingFlag(string pUsingFlag) { DataSet ds = null; DbMember db = null; try { string dbCon_IP = WebConfigurationManager.ConnectionStrings["ConnectionStr_IP"].ConnectionString; string dbCon_DB = WebConfigurationManager.ConnectionStrings["ConnectionStr_DB"].ConnectionString; string dbCon_USER = WebConfigurationManager.ConnectionStrings["ConnectionStr_USER"].ConnectionString; db = new DbMember(dbCon_IP, dbCon_DB, dbCon_USER); ds = db.sMember_UsingFlag(pUsingFlag); } catch (Exception ex) { _logs.SaveLog("[error] (page)::BizMember.cs (Function)::sMemcoMainDB_UsingFlag (Detail)::pUsingFlag=[" + pUsingFlag + "]", "Error"); _logs.SaveLog("[error] (page)::BizMember.cs (Function)::sMemcoMainDB_UsingFlag (Detail)::" + "\r\n" + ex.ToString(), "Error"); } finally { if (db != null) { db.DisConnect(); } } return(ds); }
//CONST CMB BOX WITHOUT NOSELECT public DataSet devTypeCmb() { DataSet ds = null; DbDevice db = null; try { string dbCon_IP = WebConfigurationManager.ConnectionStrings["ConnectionStr_IP"].ConnectionString; string dbCon_DB = WebConfigurationManager.ConnectionStrings["ConnectionStr_DB"].ConnectionString; string dbCon_USER = WebConfigurationManager.ConnectionStrings["ConnectionStr_USER"].ConnectionString; db = new DbDevice(dbCon_IP, dbCon_DB, dbCon_USER, "0"); ds = db.devTypeCmb(); } catch (Exception ex) { logs.SaveLog("[error] (page)::BizDevice.cs (Function)::devTypeCmb (Detail)::" + "\r\n" + ex.ToString(), "Error"); } finally { if (db != null) { db.DisConnect(); } } return(ds); }
public string sDbNm(string pMemcoCd) { string reVal = ""; DbMainHome db = null; try { string dbCon_IP = WebConfigurationManager.ConnectionStrings["ConnectionStr_IP"].ConnectionString; string dbCon_DB = WebConfigurationManager.ConnectionStrings["ConnectionStr_DB"].ConnectionString; string dbCon_USER = WebConfigurationManager.ConnectionStrings["ConnectionStr_USER"].ConnectionString; db = new DbMainHome(dbCon_IP, dbCon_DB, dbCon_USER); reVal = db.sDbNm(pMemcoCd); } catch (Exception ex) { _logs.SaveLog("[error] (page)::BizMainHome.cs (Function)::sDbNm (Detail)::pMemcoCd=[" + pMemcoCd + "]", "Error"); _logs.SaveLog("[error] (page)::BizMainHome.cs (Function)::sDbNm (Detail)::" + "\r\n" + ex.ToString(), "Error"); } finally { if (db != null) db.DisConnect(); } return reVal; }
public string siteDbNm(string pSiteCd) { string reVal = ""; DbSysAuthSiteDB db = null; try { string dbCon_IP = WebConfigurationManager.ConnectionStrings["ConnectionStr_IP"].ConnectionString; string dbCon_DB = WebConfigurationManager.ConnectionStrings["ConnectionStr_DB"].ConnectionString; string dbCon_USER = WebConfigurationManager.ConnectionStrings["ConnectionStr_USER"].ConnectionString; db = new DbSysAuthSiteDB(dbCon_IP, dbCon_DB, dbCon_USER); reVal = db.siteDbNm(pSiteCd); } catch (Exception ex) { logs.SaveLog("[error] (page)::BizSysSiteDB.cs (Function)::siteDbNm (Detail)::pSiteCd=[" + pSiteCd + "]", "Error"); logs.SaveLog("[error] (page)::BizSysSiteDB.cs (Function)::siteDbNm (Detail)::" + "\r\n" + ex.ToString(), "Error"); } finally { if (db != null) { db.DisConnect(); } } return(reVal); }
public string psSysCodeGrp(string pScodeGrp, out List <DataSysCodeGrpPra> reList, out string reMsg) { string reCode = "N"; DataSet ds = null; BizSysCodeGrpPra bizSys = null; try { bizSys = new BizSysCodeGrpPra(); try { ds = bizSys.psSysCodeGrp(pScodeGrp); reMsg = "[검색 성공]"; reCode = "Y"; } catch (Exception ex) { reMsg = "[검색 실패]" + ex.ToString(); reCode = "N"; } } catch (Exception ex) { reMsg = "[검색 에러] :: " + ex.ToString(); reCode = "N"; } List <DataSysCodeGrpPra> data = new List <DataSysCodeGrpPra>(); try { data = ListClass.ConvertDataTableToList <DataSysCodeGrpPra>(ds.Tables[0]); } catch (Exception ex) { logs.SaveLog("[error] (page)::WsSysCodeGrp.svc (Function)::sSysCodeGrp (Detail)::ConvertDataTableToList " + "\r\n" + ex.ToString(), "Error"); reMsg += "/[List 에러]" + ex.ToString(); reCode = "N"; } reList = data; return(reCode); }
public string sSysAuthMainDB(string pUsingFlag, out List <DataSysAuthMainDB> reList, out string reMsg) //셀렉트 { string reCode = "N"; DataSet ds = null; BizSysAuthMainDB bizSys = null; try { bizSys = new BizSysAuthMainDB(); try { ds = bizSys.sSysAuthMainDB(pUsingFlag); reMsg = "[검색 성공]"; reCode = "Y"; } catch (Exception ex) { reMsg = "[검색 실패]" + ex.ToString(); reCode = "N"; } } catch (Exception ex) { reMsg = "[검색 에러] :: " + ex.ToString(); reCode = "N"; } List <DataSysAuthMainDB> data = new List <DataSysAuthMainDB>(); try { data = ListClass.ConvertDataTableToList <DataSysAuthMainDB>(ds.Tables[0]); } catch (Exception ex) { logs.SaveLog("[error] (page)::WsSysAuthMainDB.svc (Function)::sSysAuthMainDB (Detail)::ConvertDataTableToList " + "\r\n" + ex.ToString(), "Error"); reMsg += "/[List 에러]" + ex.ToString(); reCode = "N"; } reList = data; return(reCode); }
public string sSiteMenu(string pDbNm, string pSiteCd, out List <DataTopMenu> reList, out string reMsg) { string reCode = "N"; DataSet ds = null; BizMainHome bizHome = null; try { bizHome = new BizMainHome(); try { ds = bizHome.sSiteMenu(pDbNm, pSiteCd); reMsg = "[검색 성공]"; reCode = "Y"; } catch (Exception ex) { reMsg = "[검색 실패]" + ex.ToString(); reCode = "N"; } } catch (Exception ex) { reMsg = "[검색 에러 - BizMainHome 연결 실패] :: " + ex.ToString(); reCode = "N"; } List <DataTopMenu> data = new List <DataTopMenu>(); try { data = ListClass.ConvertDataTableToList <DataTopMenu>(ds.Tables[0]); } catch (Exception ex) { logs.SaveLog("[error] (page)::WsMainHome.svc (Function)::sSiteMenu (Detail)::ConvertDataTableToList " + "\r\n" + ex.ToString(), "Error"); reMsg += "/[List 에러]" + ex.ToString(); reCode = "N"; } reList = data; return(reCode); }
//DEVICE TYPE CMB BOX public string devTypeCmb(out List <DataDevCombo> reList, out string reMsg) { string reCode = "N"; DataSet ds = null; BizDevice bizSys = null; try { bizSys = new BizDevice(); try { ds = bizSys.devTypeCmb(); reMsg = "[검색 성공]"; reCode = "Y"; } catch (Exception ex) { reMsg = "[검색 실패]" + ex.ToString(); reCode = "N"; } } catch (Exception ex) { reMsg = "[검색 에러] :: " + ex.ToString(); reCode = "N"; } List <DataDevCombo> data = new List <DataDevCombo>(); try { data = ListClass.ConvertDataTableToList <DataDevCombo>(ds.Tables[0]); } catch (Exception ex) { logs.SaveLog("[error] (page)::WsDevice.svc (Function)::devTypeCmb (Detail)::ConvertDataTableToList " + "\r\n" + ex.ToString(), "Error"); reMsg += "/[List 에러]" + ex.ToString(); reCode = "N"; } reList = data; return(reCode); }
public DataSet sSysAuthMainDB(string pUsingFlag) { DataSet ds = null; DbSysAuthMainDB db = null; try { string dbCon_IP = WebConfigurationManager.ConnectionStrings["ConnectionStr_IP"].ConnectionString; string dbCon_DB = WebConfigurationManager.ConnectionStrings["ConnectionStr_DB"].ConnectionString; string dbCon_USER = WebConfigurationManager.ConnectionStrings["ConnectionStr_USER"].ConnectionString; db = new DbSysAuthMainDB(dbCon_IP, dbCon_DB, dbCon_USER); ds = db.sDbSysAuthMainDB(pUsingFlag); } catch (Exception ex) { logs.SaveLog("[error] (page)::BizSysAuthMainDB.cs (Function)::sDbSysAuthMainDB (Detail)::" + "\r\n" + ex.ToString(), "Error"); } finally { if (db != null) { db.DisConnect(); } } return(ds); }
private Entity.PublisherKey GetPublisherInfo(string key, string serverIP, short serviceID) { try { lock (_lock) { if (LIST_PUBLISHER_KEY == null) { LIST_PUBLISHER_KEY = new Dictionary <string, Entity.PublisherKey>(); } if (!string.IsNullOrEmpty(key) && LIST_PUBLISHER_KEY.ContainsKey(key)) { Entity.PublisherKey p; LIST_PUBLISHER_KEY.TryGetValue(key, out p); return(p); } else { Models.ManagerModel managerModel = new Models.ManagerModel(); int code = -1; var p = managerModel.CustomerModel.GetPublisherKey(key, serviceID, serverIP, ref code); if (p != null && p.Rows.Count > 0 && code == 0) { if (!LIST_PUBLISHER_KEY.ContainsKey(key)) { Entity.PublisherKey publisherInfo = new Entity.PublisherKey(); publisherInfo.publisherID = int.Parse(p.Rows[0]["PublisherID"].ToString()); publisherInfo.publickey = key; publisherInfo.secretkey = p.Rows[0]["Secretkey"].ToString(); publisherInfo.serverIP = p.Rows[0]["ServerIP"].ToString(); publisherInfo.serviceID = short.Parse(p.Rows[0]["ServiceID"].ToString()); publisherInfo.version = p.Rows[0]["Version"].ToString(); LIST_PUBLISHER_KEY.Add(key, publisherInfo); LogClass.SaveLog("Cache Publisher: " + JsonConvert.SerializeObject(publisherInfo)); } return(LIST_PUBLISHER_KEY[key]); } else { return(new Entity.PublisherKey()); } } } } catch (Exception ex) { LogClass.SaveError("Error GetPublisherInfo: " + ex.ToString(), ex, true); return(new Entity.PublisherKey()); } }
public string sSysSysCode(out List <DataCodeGroup> reList, out string reMsg) { string reCode = "N"; DataSet ds = null; BizSysSysCode bizSysSysCode = null; try { bizSysSysCode = new BizSysSysCode(); ds = bizSysSysCode.sSysCodeGrp(); reCode = "Y"; try { ds = bizSysSysCode.sSysCodeGrp(); reMsg = "[검색 성공]"; reCode = "Y"; } catch (Exception ex) { reMsg = "[검색 실패]" + ex.ToString(); reCode = "N"; } } catch (Exception ex) { reMsg = "[검색 에러 - BizSystem 연결 실패] :: " + ex.ToString(); reCode = "N"; } List <DataCodeGroup> data = new List <DataCodeGroup>(); try { data = ListClass.ConvertDataTableToList <DataCodeGroup>(ds.Tables[0]); } catch (Exception ex) { logs.SaveLog("[error] (page)::WebSvcSystem.svc (Function)::sSiteMenu (Detail)::ConvertDataTableToList " + "\r\n" + ex.ToString(), "Error"); reMsg += "/[List 에러]" + ex.ToString(); reCode = "N"; } reList = data; return(reCode); }
/// <summary> /// Lay thong tin publisher secretkey /// </summary> /// <param name="publickey"></param> /// <param name="serviceID"></param> /// <param name="serverIP"></param> /// <param name="code"></param> /// <returns></returns> public DataTable GetPublisherKey(string publickey, short serviceID, string serverIP, ref int code) { try { LogClass.SaveLog("GetPublisherKey: " + publickey + "," + serverIP); DataTable dt = new DataTable(); using (SqlConnection connection = new SqlConnection(connectString2)) { connection.Open(); using (SqlCommand cmd = new SqlCommand()) { cmd.CommandTimeout = Constants.TIMOUT_CONNECT_SQL; cmd.Connection = connection; cmd.CommandType = CommandType.StoredProcedure; cmd.CommandText = "sp_GetPublisherKey"; cmd.Parameters.Add("@PublicKey", SqlDbType.VarChar, 32); cmd.Parameters["@PublicKey"].Value = publickey; cmd.Parameters.Add("@ServiceID", SqlDbType.SmallInt); cmd.Parameters["@ServiceID"].Value = serviceID; cmd.Parameters.Add("@ServerIP", SqlDbType.VarChar, 200); cmd.Parameters["@ServerIP"].Value = serverIP; cmd.Parameters.Add("@Code", SqlDbType.Int); cmd.Parameters["@Code"].Direction = ParameterDirection.Output; using (SqlDataReader dr = cmd.ExecuteReader()) { dt.Load(dr); } code = int.Parse(cmd.Parameters["@Code"].Value.ToString()); } } return(dt); } catch (Exception ex) { LogClass.SaveError("ERROR GetPublisherKey: " + ex); return(null); } }
//CONST CMB BOX public string constCmb(string pSiteCd, out List <DataConstCmb> reList, out string reMsg) { string reCode = "N"; DataSet ds = null; BizCompany bizSys = null; try { bizSys = new BizCompany(); try { ds = bizSys.constCmb(pSiteCd); reMsg = "[검색 성공]"; reCode = "Y"; } catch (Exception ex) { reMsg = "[검색 실패]" + ex.ToString(); reCode = "N"; } } catch (Exception ex) { reMsg = "[검색 에러] :: " + ex.ToString(); reCode = "N"; } List <DataConstCmb> data = new List <DataConstCmb>(); try { data = ListClass.ConvertDataTableToList <DataConstCmb>(ds.Tables[0]); } catch (Exception ex) { logs.SaveLog("[error] (page)::WsSysCompanyTeam.svc (Function)::constCmb (Detail)::ConvertDataTableToList " + "\r\n" + ex.ToString(), "Error"); reMsg += "/[List 에러]" + ex.ToString(); reCode = "N"; } reList = data; return(reCode); }
public string sDbNm(string pMemcoCd, out string reData, out string reMsg) { string reCode = "N"; string reVal = ""; BizSysAuthMemberDB bizHome = null; try { bizHome = new BizSysAuthMemberDB(); try { reVal = bizHome.sDbNm(pMemcoCd); reMsg = "[검색 성공]"; reCode = "Y"; } catch (Exception ex) { reMsg = "[검색 실패]" + ex.ToString(); reCode = "N"; } } catch (Exception ex) { logs.SaveLog("[error] (page)::WsSysAuthMemberDB.svc (Function)::sDbNm (Detail)::ConvertDataTableToList " + "\r\n" + ex.ToString(), "Error"); reMsg = "[검색 에러 - BizSystem 연결 실패] :: " + ex.ToString(); reCode = "N"; } reData = reVal; return(reCode); }
//DEVICE TYPE CMB BOX public string sLaborCompanyList(string pSiteCd, string pAuthCd, string pCoCd, out List <DataComCombo> reList, out string reMsg) { string reCode = "N"; DataSet ds = null; BizInOut bizInOut = null; try { bizInOut = new BizInOut(); try { ds = bizInOut.sLaborCompanyList(pSiteCd, pAuthCd, pCoCd); reMsg = "[검색 성공]"; reCode = "Y"; } catch (Exception ex) { reMsg = "[검색 실패]" + ex.ToString(); reCode = "N"; } } catch (Exception ex) { reMsg = "[검색 에러] :: " + ex.ToString(); reCode = "N"; } List <DataComCombo> data = new List <DataComCombo>(); try { data = ListClass.ConvertDataTableToList <DataComCombo>(ds.Tables[0]); } catch (Exception ex) { logs.SaveLog("[error] (page)::WsInOut.svc (Function)::sLaborCompanyList (Detail)::ConvertDataTableToList " + "\r\n" + ex.ToString(), "Error"); reMsg += "/[List 에러]" + ex.ToString(); reCode = "N"; } reList = data; return(reCode); }
public string sMenuTopTreeView(out List <DataMenuTop> reList, out string reMsg) { string reCode = "N"; DataSet ds = null; BizMenuMainDB bizMenu = null; try { bizMenu = new BizMenuMainDB(); try { ds = bizMenu.sMenuTopTreeView(); reMsg = "[검색 성공]"; reCode = "Y"; } catch (Exception ex) { reMsg = "[검색 실패]" + ex.ToString(); reCode = "N"; } } catch (Exception ex) { reMsg = "[검색 에러] :: " + ex.ToString(); reCode = "N"; } List <DataMenuTop> data = new List <DataMenuTop>(); try { data = ListClass.ConvertDataTableToList <DataMenuTop>(ds.Tables[0]); } catch (Exception ex) { logs.SaveLog("[error] (page)::WsMenuMainDB.svc (Function)::sMenuTopTreeView (Detail)::ConvertDataTableToList " + "\r\n" + ex.ToString(), "Error"); reMsg += "/[List 에러]" + ex.ToString(); reCode = "N"; } reList = data; return(reCode); }
//CONST CMB BOX WITHOUT NOSELECT public DataSet sLaborCompanyList(string pSiteCd, string pAuthCd, string pCoCd) { DataSet ds = null; DbInOut db = null; try { string dbCon_IP = WebConfigurationManager.ConnectionStrings["ConnectionStr_IP"].ConnectionString; string dbCon_DB = WebConfigurationManager.ConnectionStrings["ConnectionStr_DB"].ConnectionString; string dbCon_USER = WebConfigurationManager.ConnectionStrings["ConnectionStr_USER"].ConnectionString; db = new DbInOut(dbCon_IP, dbCon_DB, dbCon_USER, "0"); //MYCOM_FLAG 값을 구해옴 //string pMyComFlag = ""; //pMyComFlag = db.sMyComFlag(pSiteCd, pAuthCd); ds = db.sLaborCompanyList(pSiteCd, Convert.ToInt16(pCoCd)); } catch (Exception ex) { logs.SaveLog("[error] (page)::BizInOut.cs (Function)::sLaborCompanyList (Detail)::pSiteCd=[" + pSiteCd + "], " + " pAuthCd=[" + pAuthCd + "], pCoCd=[" + pCoCd + "]", "Error"); logs.SaveLog("[error] (page)::BizInOut.cs (Function)::sLaborCompanyList (Detail)::" + "\r\n" + ex.ToString(), "Error"); } finally { if (db != null) { db.DisConnect(); } } return(ds); }
//** LABOR SEARCH PART START ** //BLOCK CMB BOX public DataSet sLaborBlockList(string pSiteCd, string pAuthCd, string pCcode, string pLngBlock) { DataSet ds = null; DbLaborSearch db = null; try { string dbCon_IP = WebConfigurationManager.ConnectionStrings["ConnectionStr_IP"].ConnectionString; string dbCon_DB = WebConfigurationManager.ConnectionStrings["ConnectionStr_DB"].ConnectionString; string dbCon_USER = WebConfigurationManager.ConnectionStrings["ConnectionStr_USER"].ConnectionString; db = new DbLaborSearch(dbCon_IP, dbCon_DB, dbCon_USER, "0"); DataSet ds1 = db.sMyFlags(pSiteCd, pAuthCd); string pMyBlockFlag = ds1.Tables[0].Rows[0]["MYBLOCK_FLAG"].ToString(); ds = db.sLaborBlockList(pSiteCd, Convert.ToInt16(pMyBlockFlag), Convert.ToInt16(pCcode), pLngBlock); } catch (Exception ex) { logs.SaveLog("[error] (page)::BizLaborSearch.cs (Function)::sLaborBlockList (Detail):: " + " pSiteCd=['" + pSiteCd + "'], pAuthCd=[" + pAuthCd + "], pCcode=[" + pCcode + "],pLngBlock=[" + pLngBlock + "]", "Error"); logs.SaveLog("[error] (page)::BizLaborSearch.cs (Function)::sLaborBlockList (Detail)::" + "\r\n" + ex.ToString(), "Error"); } finally { if (db != null) { db.DisConnect(); } } return(ds); }
public DataSet sSysCodeGrp(string pScodeGrp) { DataSet ds = null; DbSysCodeGrp db = null; try { string dbCon_IP = WebConfigurationManager.ConnectionStrings["ConnectionStr_IP"].ConnectionString; string dbCon_DB = WebConfigurationManager.ConnectionStrings["ConnectionStr_DB"].ConnectionString; string dbCon_USER = WebConfigurationManager.ConnectionStrings["ConnectionStr_USER"].ConnectionString; db = new DbSysCodeGrp(dbCon_IP, dbCon_DB, dbCon_USER); ds = db.sSysCodeGrp(pScodeGrp); } catch (Exception ex) { _logs.SaveLog("[error] (page)::BizSysCodeGrp.cs (Function)::sSysCodeGrp (Detail)::pScodeGrp=[" + pScodeGrp + "]", "Error"); _logs.SaveLog("[error] (page)::BizSysCodeGrp.cs (Function)::sSysCodeGrp (Detail)::" + "\r\n" + ex.ToString(), "Error"); } finally { if (db != null) { db.DisConnect(); } } return(ds); }
public DataSet sMenuTopTreeView() { DataSet ds = null; DbMenuMainDB db = null; try { string dbCon_IP = WebConfigurationManager.ConnectionStrings["ConnectionStr_IP"].ConnectionString; string dbCon_DB = WebConfigurationManager.ConnectionStrings["ConnectionStr_DB"].ConnectionString; string dbCon_USER = WebConfigurationManager.ConnectionStrings["ConnectionStr_USER"].ConnectionString; db = new DbMenuMainDB(dbCon_IP, dbCon_DB, dbCon_USER); ds = db.sMenuTopTreeView(); } catch (Exception ex) { _logs.SaveLog("[error] (page)::BizMenuMainDB.cs (Function)::sMenuTopTreeView (Detail)::", "Error"); _logs.SaveLog("[error] (page)::BizMenuMainDB.cs (Function)::sMenuTopTreeView (Detail)::" + "\r\n" + ex.ToString(), "Error"); } finally { if (db != null) { db.DisConnect(); } } return(ds); }
public HttpResponseMessage InputCard(PayloadApi p) { LogClass.SaveCustomerLog("InputCard: " + JsonConvert.SerializeObject(p)); ResultApi result = new ResultApi(); CardObject cardObject = new CardObject(); try { var publisherInfo = publisher.CheckPublickey(p, version); if (publisherInfo.status == (int)ERROR_CODDE.SUCCESS) { ManagerModel managerModel = new ManagerModel(); var data = JsonConvert.DeserializeObject <InputCard>(publisherInfo.data.ToString()); string msg = ""; if (data.CardType != 1 && data.CardType != 2 && data.CardType != 3) { result.msg = "CardType sai định dạng"; return(null); } int successtransaction = 0; int errortransaction = 0; int errorsavelog = 0; short debug = 0; try { string serviceCode = string.Empty; if (data.CardType == 1) { serviceCode = "VTT"; } else if (data.CardType == 2) { serviceCode = "VMS"; } else if (data.CardType == 3) { serviceCode = "VNP"; } debug = 1; for (int i = 0; i < data.Qty; i++) { debug = 2; long transactionId = DateTime.Now.Ticks; var service = new muathe24h.MechantServicesSoapClient(); string email = "*****@*****.**"; string pass = "******"; var res = service.BuyCards(new muathe24h.UserCredentials { userName = email, pass = pass } , transactionId.ToString(), serviceCode, data.Amount, 1); debug = 3; LogClass.SaveLog("muathe24h" + JsonConvert.SerializeObject(res)); string resultCode = res?.RepCode.ToString(); debug = 4; //Khoi tao ket qua ghi log mac dinh cardObject.Amount = data.Amount; cardObject.Experied = string.Empty; cardObject.CardType = data.CardType; cardObject.TelCode = serviceCode; cardObject.TradeMark = "muathe24h"; cardObject.BuyTime = DateTime.Now; cardObject.ResultCode = resultCode; debug = 5; if (res != null && res.RepCode == 0) { successtransaction++; var seri = JsonConvert.DeserializeObject <List <CardObject_Muathe24h> >(res.Data.ToString()); //Mua thanh cong ghi lai code va seri the cardObject.CardCode = seri[0].PinCode; cardObject.CardSerial = seri[0].Serial; cardObject.TransactionCode = transactionId.ToString(); cardObject.Status = true; //Mua thanh cong LogClass.SaveLog("cardObject buy success:" + JsonConvert.SerializeObject(cardObject)); result.status = managerModel.GameAcountModel.INPUT_CARD(cardObject, ref msg); if (result.status != 1) { debug = 3; errorsavelog++; cardObject.CardCode = string.Empty; cardObject.CardSerial = string.Empty; cardObject.TransactionCode = string.Empty; cardObject.Status = false; // Mua that bai LogClass.SaveLog("cardObject savelog error:" + JsonConvert.SerializeObject(cardObject)); managerModel.GameAcountModel.INPUT_CARD(cardObject, ref msg); } } else //Mua the that bai { debug = 4; errortransaction++; cardObject.CardCode = string.Empty; cardObject.CardSerial = string.Empty; cardObject.TransactionCode = string.Empty; cardObject.Status = false; // Mua that bai LogClass.SaveLog("cardObject buy card error:" + JsonConvert.SerializeObject(cardObject)); managerModel.GameAcountModel.INPUT_CARD(cardObject, ref msg); } } } catch (Exception ex) { LogClass.SaveError("Mua thẻ thất bại" + ex + "\n,cardObject:" + JsonConvert.SerializeObject(cardObject)); } string msgTotalBuyCard = "Mua thành công " + successtransaction + " thẻ"; if (errortransaction > 0) { msgTotalBuyCard += " và thất bại " + errortransaction + " thẻ"; } if (errorsavelog > 0) { msgTotalBuyCard += ". Ghi log thất bại " + errorsavelog + " thẻ"; } result.msg = msgTotalBuyCard; } else { result = publisherInfo; } } catch (Exception ex) { LogClass.SaveError("ERROR InputCard: " + ex.Message + "\n,cardObject:" + JsonConvert.SerializeObject(cardObject), ex, true); result.status = (int)ERROR_CODDE.ERROR_EX; result.msg = ex.Message; } return(Request.CreateResponse(result)); }
public DataSet sComnCodeGrp() { DataSet ds = null; DbComnCodeGrpMainDB db = null; try { string dbCon_IP = WebConfigurationManager.ConnectionStrings["ConnectionStr_IP"].ConnectionString; string dbCon_DB = WebConfigurationManager.ConnectionStrings["ConnectionStr_DB"].ConnectionString; string dbCon_USER = WebConfigurationManager.ConnectionStrings["ConnectionStr_USER"].ConnectionString; db = new DbComnCodeGrpMainDB(dbCon_IP, dbCon_DB, dbCon_USER, "0"); ds = db.sComnCodeGrp(); } catch (Exception ex) { logs.SaveLog("[error] (page)::BizComnCodeGrp.cs (Function)::sComnCodeGrp (Detail)::pScodeGrp=[ ]", "Error"); logs.SaveLog("[error] (page)::BizComnCodeGrp.cs (Function)::sComnCodeGrp (Detail)::" + "\r\n" + ex.ToString(), "Error"); } finally { if (db != null) { db.DisConnect(); } } return(ds); }
//COMPANY CMB BOX public DataSet companyCmb(string pSiteCd) { DataSet ds = null; DbTeam db = null; try { string dbCon_IP = WebConfigurationManager.ConnectionStrings["ConnectionStr_IP"].ConnectionString; string dbCon_DB = WebConfigurationManager.ConnectionStrings["ConnectionStr_DB"].ConnectionString; string dbCon_USER = WebConfigurationManager.ConnectionStrings["ConnectionStr_USER"].ConnectionString; db = new DbTeam(dbCon_IP, dbCon_DB, dbCon_USER, "0"); ds = db.companyCmb(pSiteCd); } catch (Exception ex) { _logs.SaveLog("[error] (page)::BizTeam.cs (Function)::companyCmb (Detail)::" + "\r\n" + ex.ToString(), "Error"); } finally { if (db != null) { db.DisConnect(); } } return(ds); }