public ActionResult Action(string guid, string name, string country, string state, string city, string district, string address, string phone) { Orm.Orm_conf_all_address orm_Conf_All_Address = new Orm.Orm_conf_all_address(); orm_Conf_All_Address.guid = guid; orm_Conf_All_Address.name = name; orm_Conf_All_Address.country = country; orm_Conf_All_Address.city = city; orm_Conf_All_Address.state = state; orm_Conf_All_Address.district = district; orm_Conf_All_Address.address = address; orm_Conf_All_Address.phone = phone; orm_Conf_All_Address.def = "1"; string query = "select * from conf_all_address where guid=@guid and def=@def"; List <Orm.Orm_conf_all_address> orm_Conf_All_Addresses_Lst = new List <Orm.Orm_conf_all_address>(); orm_Conf_All_Addresses_Lst = dbConnection.Query <Orm.Orm_conf_all_address>(query, orm_Conf_All_Address).ToList(); if (orm_Conf_All_Addresses_Lst.Count > 0) { orm_Conf_All_Address.def = "0"; } query = "insert into conf_all_address(guid,name,country,state,city,district,address,phone) values(@guid,@name,@country,@state,@city,@district,@address,@phone)"; /*dbConnection.Execute(query, orm_Conf_All_Address);*/ var id = dbConnection.Query <int>(query, orm_Conf_All_Address).FirstOrDefault(); Conf_ResponseMessage conf_ResponseMessageObj = new Conf_ResponseMessage(); conf_ResponseMessageObj.code = "200"; conf_ResponseMessageObj.status = "ok"; conf_ResponseMessageObj.message = id.ToString(); HttpContext.Response.StatusCode = 200; return(Json(conf_ResponseMessageObj)); }
public ActionResult Action(string tablename) { try { if (!string.IsNullOrEmpty(tablename)) { string query = "select * from " + tablename; var result = dbConnection.Query(query).AsList(); return(Json(result)); } else { Conf_ResponseMessage conf_ResponseMessageObj = new Conf_ResponseMessage(); conf_ResponseMessageObj.code = "424"; conf_ResponseMessageObj.status = "Error"; conf_ResponseMessageObj.message = "Tablename is empty"; HttpContext.Response.StatusCode = 424; return(Json(conf_ResponseMessageObj)); } } catch { Conf_ResponseMessage conf_ResponseMessageObj = new Conf_ResponseMessage(); conf_ResponseMessageObj.code = "424"; conf_ResponseMessageObj.status = "Error"; conf_ResponseMessageObj.message = "Faild to execute"; HttpContext.Response.StatusCode = 424; return(Json(conf_ResponseMessageObj)); } }
public ActionResult Action(int id) { try { Orm.Orm_conf_all_address orm_Conf_All_Address = new Orm.Orm_conf_all_address(); orm_Conf_All_Address.id = id; string query = "delete from conf_all_address where id=@id"; dbConnection.Execute(query, orm_Conf_All_Address); Conf_ResponseMessage conf_ResponseMessageObj = new Conf_ResponseMessage(); conf_ResponseMessageObj.code = "200"; conf_ResponseMessageObj.status = "ok"; conf_ResponseMessageObj.message = "Executed"; HttpContext.Response.StatusCode = 200; return(Json(conf_ResponseMessageObj)); } catch { Conf_ResponseMessage conf_ResponseMessageObj = new Conf_ResponseMessage(); conf_ResponseMessageObj.code = "500"; conf_ResponseMessageObj.status = "error"; conf_ResponseMessageObj.message = "faild to remove"; HttpContext.Response.StatusCode = 500; return(Json(conf_ResponseMessageObj)); } }
public ActionResult Action(int proid, string guid, int count, string modell1, string modell2) { Global.GlobalTestingLog globalTestingLog = new Global.GlobalTestingLog("ShopingCartUpdate"); try { Orm.Orm_conf_all_shopcart orm_Conf_All_Shopcart = new Orm.Orm_conf_all_shopcart(); orm_Conf_All_Shopcart.guid = guid; orm_Conf_All_Shopcart.proid = proid; orm_Conf_All_Shopcart.count = count; orm_Conf_All_Shopcart.modell1 = modell1; orm_Conf_All_Shopcart.modell2 = modell2; orm_Conf_All_Shopcart.udt = DateTime.Now.ToString(); string query = "update conf_all_shopcart set count=@count,udt=@udt where proid=@proid and guid=@guid and modell1=@modell1 and modell2=@modell2"; dbConnection.Execute(query, orm_Conf_All_Shopcart); Conf_ResponseMessage conf_ResponseMessageObj = new Conf_ResponseMessage(); conf_ResponseMessageObj.code = "200"; conf_ResponseMessageObj.status = "ok"; conf_ResponseMessageObj.message = "Executed"; HttpContext.Response.StatusCode = 200; return(Json(conf_ResponseMessageObj)); } catch (Exception err) { globalTestingLog.AddRecord("stace", err.StackTrace); globalTestingLog.AddRecord("msg", err.Message); return(Content("")); } }
public ActionResult Action(int proid, string titleimg = "0") { Orm.Orm_conf_all_proitems_imgs orm_Conf_All_Proitems_Imgs = new Orm.Orm_conf_all_proitems_imgs(); orm_Conf_All_Proitems_Imgs.proid = proid; if (titleimg == "1") { orm_Conf_All_Proitems_Imgs.titleimg = "1"; } else { orm_Conf_All_Proitems_Imgs.titleimg = "0"; } string query = "select * from conf_all_proitems_imgs where proid=@proid and titleimg=@titleimg"; List <Orm.Orm_conf_all_proitems_imgs> orm_Conf_All_Proitems_Imgs_Lst = dbConnection.Query <Orm.Orm_conf_all_proitems_imgs>(query, orm_Conf_All_Proitems_Imgs).ToList(); if (orm_Conf_All_Proitems_Imgs_Lst.Count > 0) { return(Json(orm_Conf_All_Proitems_Imgs_Lst)); } else { Conf_ResponseMessage conf_ResponseMessageObj = new Conf_ResponseMessage(); conf_ResponseMessageObj.code = "411"; conf_ResponseMessageObj.status = "Error"; conf_ResponseMessageObj.message = "No Data"; HttpContext.Response.StatusCode = 411; return(Json(conf_ResponseMessageObj)); } }
public ActionResult Action(string guid, string openid, string uid, string password) { Orm.Orm_conf_all_users orm_Conf_All_Users = new Orm.Orm_conf_all_users(); orm_Conf_All_Users.guid = guid; orm_Conf_All_Users.openid = openid; orm_Conf_All_Users.uid = uid; orm_Conf_All_Users.password = password; string query = "select * from conf_all_users where openid=@openid or guid=@guid"; Orm.Orm_conf_all_users orm_Conf_All_Users_Selected = dbConnection.Query <Orm.Orm_conf_all_users>(query).SingleOrDefault(); Conf_ResponseMessage conf_ResponseMessageObj; if (orm_Conf_All_Users_Selected != null) { query = "update conf_all_users set uid=@uid,password=@password where openid=@openid or guid=@guid"; dbConnection.Execute(query); conf_ResponseMessageObj = new Conf_ResponseMessage(); conf_ResponseMessageObj.code = "200"; conf_ResponseMessageObj.status = "ok"; conf_ResponseMessageObj.message = "Executed"; HttpContext.Response.StatusCode = 200; return(Json(conf_ResponseMessageObj)); } else { conf_ResponseMessageObj = new Conf_ResponseMessage(); conf_ResponseMessageObj.code = "500"; conf_ResponseMessageObj.status = "error"; conf_ResponseMessageObj.message = "faild to reset user"; HttpContext.Response.StatusCode = 500; return(Json(conf_ResponseMessageObj)); } }
public ActionResult Action(int proid, string guid) { Global.GlobalTestingLog globalTestingLog = new Global.GlobalTestingLog("ShopingCartUpdate"); try { string query = "select * from conf_all_shopcart where proid=" + proid + " and guid='" + guid + "' and selected='1'"; Orm.Orm_conf_all_shopcart orm_Conf_All_Shopcart_selected = dbConnection.Query <Orm.Orm_conf_all_shopcart>(query).FirstOrDefault(); Orm.Orm_conf_all_shopcart orm_Conf_All_Shopcart = new Orm.Orm_conf_all_shopcart(); orm_Conf_All_Shopcart.guid = guid; orm_Conf_All_Shopcart.proid = proid; if (orm_Conf_All_Shopcart_selected != null) { orm_Conf_All_Shopcart.selected = "0"; } else { orm_Conf_All_Shopcart.selected = "1"; } orm_Conf_All_Shopcart.udt = DateTime.Now.ToString(); query = "update conf_all_shopcart set selected=@selected where proid=@proid and guid=@guid"; dbConnection.Execute(query, orm_Conf_All_Shopcart); Conf_ResponseMessage conf_ResponseMessageObj = new Conf_ResponseMessage(); conf_ResponseMessageObj.code = "200"; conf_ResponseMessageObj.status = "ok"; conf_ResponseMessageObj.message = "Executed"; HttpContext.Response.StatusCode = 200; return(Json(conf_ResponseMessageObj)); } catch (Exception err) { globalTestingLog.AddRecord("stace", err.StackTrace); globalTestingLog.AddRecord("msg", err.Message); return(Content("")); } }
public ActionResult action(string uname, string password) { Orm_lst_access_ids lstAccessObj = new Orm_lst_access_ids(); lstAccessObj.username = uname; string strQuery = "select * from lst_access_ids where username=@username"; Orm_lst_access_ids exsitedAccessObj = (Orm_lst_access_ids)dbConnection.Query <Orm_lst_access_ids>(strQuery, lstAccessObj).SingleOrDefault(); if (exsitedAccessObj != null) { Conf_ResponseMessage conf_ResponseMessageObj = new Conf_ResponseMessage(); conf_ResponseMessageObj.code = "424"; conf_ResponseMessageObj.status = "Error"; conf_ResponseMessageObj.message = "User Existed"; HttpContext.Response.StatusCode = 424; return(Json(conf_ResponseMessageObj)); } else { lstAccessObj.appid = Guid.NewGuid().ToString(); lstAccessObj.password = password; strQuery = "insert into lst_access_ids(appid,username,password) values(@appid,@username,@password)"; dbConnection.Execute(strQuery, lstAccessObj); Conf_ResponseMessage conf_ResponseMessageObj = new Conf_ResponseMessage(); conf_ResponseMessageObj.code = "200"; conf_ResponseMessageObj.status = "OK"; conf_ResponseMessageObj.message = "OK"; HttpContext.Response.StatusCode = 200; return(Json(lstAccessObj)); } }
public ActionResult Action(string uname, string password) { Orm_lst_access_ids lstAccessObj = new Orm_lst_access_ids(); lstAccessObj.username = uname; string strQuery = "select * from lst_access_ids where username=@username and password=@password"; Orm_lst_access_ids exsitedAccessObj = (Orm_lst_access_ids)dbConnection.Query <Orm_lst_access_ids>(strQuery, lstAccessObj).SingleOrDefault(); if (exsitedAccessObj != null) { Conf_ResponseMessage conf_ResponseMessageObj = new Conf_ResponseMessage(); conf_ResponseMessageObj.code = "200"; conf_ResponseMessageObj.status = "OK"; conf_ResponseMessageObj.message = exsitedAccessObj.appid; HttpContext.Response.StatusCode = 200; return(Json(conf_ResponseMessageObj)); } else { Conf_ResponseMessage conf_ResponseMessageObj = new Conf_ResponseMessage(); conf_ResponseMessageObj.code = "424"; conf_ResponseMessageObj.status = "Error"; conf_ResponseMessageObj.message = "User Not Existed Or Invalidated Password"; HttpContext.Response.StatusCode = 424; return(Json(conf_ResponseMessageObj)); } }
public ActionResult Action(string orderid) { Global.GlobalTestingLog globalTestingLog = new Global.GlobalTestingLog("AllOrderDetail"); try { string query = "select * from conf_all_orders where orderid='" + orderid + "'"; Orm.Orm_conf_all_orders orm_Conf_All_Orders = dbConnection.Query <Orm.Orm_conf_all_orders>(query).FirstOrDefault(); JC_OrderOutput newItem = new JC_OrderOutput(); newItem.orderid = orm_Conf_All_Orders.orderid; newItem.disorderid = orm_Conf_All_Orders.cdt + "_" + orm_Conf_All_Orders.id; newItem.totalprice = orm_Conf_All_Orders.totalprice; newItem.shiped = orm_Conf_All_Orders.shipped; newItem.payed = orm_Conf_All_Orders.payed; newItem.cdt = orm_Conf_All_Orders.cdt; newItem.items = new List <JC_OrderOutput_ProItem>(); newItem.status = orm_Conf_All_Orders.status; Orm.Orm_conf_all_address orm_Conf_All_Address = new Orm.Orm_conf_all_address(); query = "select * from conf_all_address where id=" + orm_Conf_All_Orders.addressid; orm_Conf_All_Address = dbConnection.Query <Orm.Orm_conf_all_address>(query).FirstOrDefault(); if (orm_Conf_All_Address != null) { newItem.name = orm_Conf_All_Address.name; newItem.address = orm_Conf_All_Address.address; newItem.phone = orm_Conf_All_Address.phone; } query = "select * from conf_all_orders_proitems where orderid='" + newItem.orderid + "'"; List <Orm.Orm_conf_all_orders_proitems> orm_Conf_All_Orders_Proitem_lst = dbConnection.Query <Orm.Orm_conf_all_orders_proitems>(query).ToList(); foreach (Orm.Orm_conf_all_orders_proitems orm_Conf_All_Orders_Proitems_Tmp in orm_Conf_All_Orders_Proitem_lst) { JC_OrderOutput_ProItem newProItem = new JC_OrderOutput_ProItem(); newProItem.proid = orm_Conf_All_Orders_Proitems_Tmp.proid; query = "select * from conf_all_proitems where id=" + orm_Conf_All_Orders_Proitems_Tmp.proid; Orm.Orm_conf_all_proitems orm_Conf_All_Proitems = dbConnection.Query <Orm.Orm_conf_all_proitems>(query).FirstOrDefault(); newProItem.title = orm_Conf_All_Proitems.title; query = "select * from conf_all_proitems_imgs where proid=" + orm_Conf_All_Orders_Proitems_Tmp.proid + " and titleimg='1'"; Orm.Orm_conf_all_proitems_imgs orm_conf_all_proitems_imgs = dbConnection.Query <Orm.Orm_conf_all_proitems_imgs>(query).FirstOrDefault(); newProItem.img = orm_conf_all_proitems_imgs.imgpath; query = "select * from conf_all_proitems_price where proid=" + orm_Conf_All_Orders_Proitems_Tmp.proid + " and modell1='" + orm_Conf_All_Orders_Proitems_Tmp.modell1 + "' and modell2='" + orm_Conf_All_Orders_Proitems_Tmp.modell2 + "'"; Orm.Orm_conf_all_proitems_price orm_Conf_All_Proitems_Price = dbConnection.Query <Orm.Orm_conf_all_proitems_price>(query).FirstOrDefault(); newProItem.price = orm_Conf_All_Proitems_Price.discount > 0 ? orm_Conf_All_Proitems_Price.basic * (orm_Conf_All_Proitems_Price.discount / 100.0) : orm_Conf_All_Proitems_Price.basic; newProItem.count = orm_Conf_All_Orders_Proitems_Tmp.count; newProItem.modell1 = orm_Conf_All_Orders_Proitems_Tmp.modell1; newProItem.modell2 = orm_Conf_All_Orders_Proitems_Tmp.modell2; newItem.items.Add(newProItem); } return(Json(newItem)); } catch (Exception err) { globalTestingLog.AddRecord("stace", err.StackTrace); globalTestingLog.AddRecord("msg", err.Message); Conf_ResponseMessage conf_ResponseMessageObj = new Conf_ResponseMessage(); conf_ResponseMessageObj.code = "500"; conf_ResponseMessageObj.status = "error"; conf_ResponseMessageObj.message = "Faild to execute"; HttpContext.Response.StatusCode = 500; return(Json(conf_ResponseMessageObj)); } }
public ActionResult Action() { Conf_ResponseMessage conf_ResponseMessageObj = new Conf_ResponseMessage(); conf_ResponseMessageObj.code = "201"; conf_ResponseMessageObj.status = "OK"; conf_ResponseMessageObj.message = "In Service"; HttpContext.Response.StatusCode = 201; return(Json(conf_ResponseMessageObj)); }
public ActionResult Action(int topicid) { Global.GlobalTestingLog globalTestingLog = new Global.GlobalTestingLog("MainSelectedProducts"); try { List <JC_TopicProducts> result = new List <JC_TopicProducts>(); string query = "select * from conf_all_proitems where id in ( select proid from conf_main_topics_products where topicsid = " + topicid + ") "; List <Orm.Orm_conf_all_proitems> lst_Orm_conf_all_proitems = dbConnection.Query <Orm.Orm_conf_all_proitems>(query).ToList(); foreach (Orm.Orm_conf_all_proitems orm_Conf_All_Proitems_tmp in lst_Orm_conf_all_proitems) { //Code JC_TopicProducts newitem = new JC_TopicProducts(); newitem.proid = orm_Conf_All_Proitems_tmp.id; newitem.title = orm_Conf_All_Proitems_tmp.title; newitem.des = orm_Conf_All_Proitems_tmp.des; query = "select * from conf_all_proitems_price where proid=" + orm_Conf_All_Proitems_tmp.id; List <Orm.Orm_conf_all_proitems_price> orm_Conf_All_Proitems_Price = dbConnection.Query <Orm.Orm_conf_all_proitems_price>(query).ToList(); if (orm_Conf_All_Proitems_Price != null && orm_Conf_All_Proitems_Price.Count > 0) { newitem.basicprice = orm_Conf_All_Proitems_Price[0].basic; newitem.price = orm_Conf_All_Proitems_Price[0].discount > 0 ? orm_Conf_All_Proitems_Price[0].basic * (orm_Conf_All_Proitems_Price[0].discount / 100.0) : orm_Conf_All_Proitems_Price[0].basic; } else { newitem.basicprice = 0; newitem.price = 0; } query = "select * from conf_all_proitems_imgs where proid=" + newitem.proid; Orm.Orm_conf_all_proitems_imgs orm_Conf_All_Proitems_Imgs = dbConnection.Query <Orm.Orm_conf_all_proitems_imgs>(query).First(); if (orm_Conf_All_Proitems_Imgs != null) { newitem.img = orm_Conf_All_Proitems_Imgs.imgpath; } newitem.type_topics = topicid.ToString(); globalTestingLog.AddRecord("Step", "2"); globalTestingLog.AddRecord("proid", newitem.proid.ToString()); result.Add(newitem); } return(Json(result)); } catch (Exception err) { globalTestingLog.AddRecord("stack:", err.StackTrace); globalTestingLog.AddRecord("msg:", err.Message); Conf_ResponseMessage conf_ResponseMessageObj = new Conf_ResponseMessage(); conf_ResponseMessageObj.code = "500"; conf_ResponseMessageObj.status = "Error"; conf_ResponseMessageObj.message = err.Message; HttpContext.Response.StatusCode = 500; return(Json(conf_ResponseMessageObj)); } }
public ActionResult Action(string orderid, string status) { string query = "update conf_all_orders set status='" + status + "' where orderid='" + orderid + "'"; dbConnection.Execute(query); Conf_ResponseMessage conf_ResponseMessageObj = new Conf_ResponseMessage(); conf_ResponseMessageObj.code = "200"; conf_ResponseMessageObj.status = "OK"; conf_ResponseMessageObj.message = orderid; HttpContext.Response.StatusCode = 200; return(Json(conf_ResponseMessageObj)); }
public ActionResult Action(string orderid) { string query = "delete from conf_all_orders where orderid='" + orderid + "'"; dbConnection.Execute(query); query = "delete from conf_all_orders_proitems where orderid='" + orderid + "'"; dbConnection.Execute(query); query = "delete from conf_all_orders_address where orderid='" + orderid + "'"; dbConnection.Execute(query); Conf_ResponseMessage conf_ResponseMessageObj = new Conf_ResponseMessage(); conf_ResponseMessageObj.code = "200"; conf_ResponseMessageObj.status = "OK"; conf_ResponseMessageObj.message = orderid; HttpContext.Response.StatusCode = 200; return(Json(conf_ResponseMessageObj)); }
public ActionResult Action(int id, string guid, string modell1, string modell2) { Orm.Orm_conf_all_shopcart orm_Conf_All_Shopcart = new Orm.Orm_conf_all_shopcart(); orm_Conf_All_Shopcart.id = id; orm_Conf_All_Shopcart.guid = guid; orm_Conf_All_Shopcart.modell1 = modell1; orm_Conf_All_Shopcart.modell2 = modell2; string query = "delete from conf_all_shopcart where id=@id and guid=@guid and modell1=@modell1 and modell2=@modell2"; dbConnection.Execute(query, orm_Conf_All_Shopcart); Conf_ResponseMessage conf_ResponseMessageObj = new Conf_ResponseMessage(); conf_ResponseMessageObj.code = "200"; conf_ResponseMessageObj.status = "ok"; conf_ResponseMessageObj.message = "Executed"; HttpContext.Response.StatusCode = 200; return(Json(conf_ResponseMessageObj)); }
public ActionResult Action(int proid, string guid, string modell1, string modell2) { string query = "select * from conf_all_shopcart where proid=" + proid + " and guid='" + guid + "' and modell1='" + modell1 + "' and modell2='" + modell2 + "'"; Orm.Orm_conf_all_shopcart orm_Conf_All_Shopcart_Selected = dbConnection.Query <Orm.Orm_conf_all_shopcart>(query).FirstOrDefault(); if (orm_Conf_All_Shopcart_Selected != null) { Orm.Orm_conf_all_shopcart orm_Conf_All_Shopcart = new Orm.Orm_conf_all_shopcart(); orm_Conf_All_Shopcart.proid = proid; orm_Conf_All_Shopcart.guid = guid; orm_Conf_All_Shopcart.count = orm_Conf_All_Shopcart_Selected.count + 1; orm_Conf_All_Shopcart.udt = DateTime.Now.ToString(); orm_Conf_All_Shopcart.modell1 = modell1; orm_Conf_All_Shopcart.modell2 = modell2; query = "update conf_all_shopcart set count=@count,udt=@udt where proid=@proid and guid=@guid and modell1='" + modell1 + "' and modell2='" + modell2 + "'"; dbConnection.Execute(query, orm_Conf_All_Shopcart); Conf_ResponseMessage conf_ResponseMessageObj = new Conf_ResponseMessage(); conf_ResponseMessageObj.code = "200"; conf_ResponseMessageObj.status = "ok"; conf_ResponseMessageObj.message = "Executed"; HttpContext.Response.StatusCode = 200; return(Json(conf_ResponseMessageObj)); } else { Orm.Orm_conf_all_shopcart orm_Conf_All_Shopcart = new Orm.Orm_conf_all_shopcart(); orm_Conf_All_Shopcart.proid = proid; orm_Conf_All_Shopcart.guid = guid; orm_Conf_All_Shopcart.count = 1; orm_Conf_All_Shopcart.cdt = DateTime.Now.ToString(); orm_Conf_All_Shopcart.udt = DateTime.Now.ToString(); orm_Conf_All_Shopcart.modell1 = modell1; orm_Conf_All_Shopcart.modell2 = modell2; query = "insert into conf_all_shopcart(guid,proid,count,cdt,udt,modell1,modell2) values(@guid,@proid,@count,@cdt,@udt,@modell1,@modell2)"; dbConnection.Execute(query, orm_Conf_All_Shopcart); Conf_ResponseMessage conf_ResponseMessageObj = new Conf_ResponseMessage(); conf_ResponseMessageObj.code = "200"; conf_ResponseMessageObj.status = "ok"; conf_ResponseMessageObj.message = "Executed"; HttpContext.Response.StatusCode = 200; return(Json(conf_ResponseMessageObj)); } }
public ActionResult Action() { Orm_sys_table lstAccessObj = new Orm_sys_table(); string strQuery = "SELECT TABLE_NAME,CREATE_TIME,UPDATE_TIME FROM information_schema.TABLES WHERE table_schema = 'woohoo'"; List <Orm_sys_table> exsitedAccessObj = dbConnection.Query <Orm_sys_table>(strQuery, lstAccessObj).ToList(); if (exsitedAccessObj != null) { HttpContext.Response.StatusCode = 200; return(Json(exsitedAccessObj)); } else { Conf_ResponseMessage conf_ResponseMessageObj = new Conf_ResponseMessage(); conf_ResponseMessageObj.code = "421"; conf_ResponseMessageObj.status = "ERROR"; conf_ResponseMessageObj.message = "Empty result or error"; HttpContext.Response.StatusCode = 421; return(Json(conf_ResponseMessageObj)); } }
public ActionResult Action(int proid, string modell1, string modell2) { Orm.Orm_conf_all_proitems_price orm_Conf_All_Proitems_Price = new Orm.Orm_conf_all_proitems_price(); orm_Conf_All_Proitems_Price.proid = proid; string query = "select * from conf_all_proitems_price where proid=@proid and modell1='" + modell1 + "' and modell2='" + modell2 + "'"; orm_Conf_All_Proitems_Price = dbConnection.Query <Orm_conf_all_proitems_price>(query).SingleOrDefault(); if (orm_Conf_All_Proitems_Price != null) { return(Json(orm_Conf_All_Proitems_Price)); } else { Conf_ResponseMessage conf_ResponseMessageObj = new Conf_ResponseMessage(); conf_ResponseMessageObj.code = "424"; conf_ResponseMessageObj.status = "Error"; conf_ResponseMessageObj.message = "No Data"; HttpContext.Response.StatusCode = 424; return(Json(conf_ResponseMessageObj)); } }
public ActionResult Action(int id, string name, string country, string state, string city, string district, string address, string phone) { Orm.Orm_conf_all_address orm_Conf_All_Address = new Orm.Orm_conf_all_address(); orm_Conf_All_Address.id = id; orm_Conf_All_Address.name = name; orm_Conf_All_Address.country = country; orm_Conf_All_Address.state = state; orm_Conf_All_Address.district = district; orm_Conf_All_Address.address = address; orm_Conf_All_Address.phone = phone; string query = "update conf_all_address set name=@name,country=@country,state=@state,city=@city,address=@address,phone=@phone where id=@id"; dbConnection.Execute(query, orm_Conf_All_Address); Conf_ResponseMessage conf_ResponseMessageObj = new Conf_ResponseMessage(); conf_ResponseMessageObj.code = "200"; conf_ResponseMessageObj.status = "ok"; conf_ResponseMessageObj.message = "Executed"; HttpContext.Response.StatusCode = 200; return(Json(conf_ResponseMessageObj)); }
public ActionResult Action(int proid) { Orm.Orm_conf_all_proitems orm_Conf_All_Proitems = new Orm.Orm_conf_all_proitems(); orm_Conf_All_Proitems.id = proid; string qurey = "select * from conf_all_proitems id=@id"; orm_Conf_All_Proitems = dbConnection.Query <Orm.Orm_conf_all_proitems>(qurey, orm_Conf_All_Proitems).SingleOrDefault(); if (orm_Conf_All_Proitems != null) { return(Json(orm_Conf_All_Proitems)); } else { Conf_ResponseMessage conf_ResponseMessageObj = new Conf_ResponseMessage(); conf_ResponseMessageObj.code = "411"; conf_ResponseMessageObj.status = "Error"; conf_ResponseMessageObj.message = "Faild to select"; HttpContext.Response.StatusCode = 411; return(Json(conf_ResponseMessageObj)); } }
public ActionResult action(int proid) { Orm.Orm_conf_all_proitems_store orm_Conf_All_Proitems_Store = new Orm.Orm_conf_all_proitems_store(); orm_Conf_All_Proitems_Store.proid = proid; string query = "select * from conf_all_proitems_store where proid=@proid"; Orm.Orm_conf_all_proitems_store orm_Conf_All_Proitems_Store_Selected = dbConnection.QuerySingleOrDefault <Orm.Orm_conf_all_proitems_store>(query, orm_Conf_All_Proitems_Store); if (orm_Conf_All_Proitems_Store_Selected != null) { return(Json(orm_Conf_All_Proitems_Store_Selected)); } else { Conf_ResponseMessage conf_ResponseMessageObj = new Conf_ResponseMessage(); conf_ResponseMessageObj.code = "424"; conf_ResponseMessageObj.status = "Error"; conf_ResponseMessageObj.message = "No Data"; HttpContext.Response.StatusCode = 424; return(Json(conf_ResponseMessageObj)); } }
public ActionResult Action(string postdata) { JC_ShopingCartItemIDList jC_ShopingCartItemIDList = (JC_ShopingCartItemIDList)JsonConvert.DeserializeObject(postdata); foreach (JC_ShopingCartItemIDList_Item activeid in jC_ShopingCartItemIDList.idlist) { Orm.Orm_conf_all_shopcart orm_Conf_All_Shopcart = new Orm.Orm_conf_all_shopcart(); orm_Conf_All_Shopcart.id = activeid.id; orm_Conf_All_Shopcart.guid = jC_ShopingCartItemIDList.guid; orm_Conf_All_Shopcart.modell1 = activeid.modell1; orm_Conf_All_Shopcart.modell2 = activeid.modell2; string query = "delete from conf_all_shopcart where id=@id and guid=@guid and modell1=@modell1 and modell2=@modell2"; dbConnection.Execute(query, orm_Conf_All_Shopcart); } Conf_ResponseMessage conf_ResponseMessageObj = new Conf_ResponseMessage(); conf_ResponseMessageObj.code = "200"; conf_ResponseMessageObj.status = "ok"; conf_ResponseMessageObj.message = "Executed"; HttpContext.Response.StatusCode = 200; return(Json(conf_ResponseMessageObj)); }
public ActionResult Action(string uid, string password) { if (string.IsNullOrEmpty(uid) || string.IsNullOrEmpty(password)) { Conf_ResponseMessage conf_ResponseMessageObj = new Conf_ResponseMessage(); conf_ResponseMessageObj.code = "424"; conf_ResponseMessageObj.status = "Error"; conf_ResponseMessageObj.message = "Empty uid or password"; HttpContext.Response.StatusCode = 424; return(Json(conf_ResponseMessageObj)); } else { Orm.Orm_conf_all_users orm_Conf_All_Users = new Orm.Orm_conf_all_users(); orm_Conf_All_Users.uid = uid; orm_Conf_All_Users.password = password; string query = "select * from conf_all_users where uid=@uid and password = @password"; Orm.Orm_conf_all_users orm_Conf_All_Users_Selected = dbConnection.Query <Orm.Orm_conf_all_users>(query, orm_Conf_All_Users).SingleOrDefault(); if (orm_Conf_All_Users_Selected == null) { Conf_ResponseMessage conf_ResponseMessageObj = new Conf_ResponseMessage(); conf_ResponseMessageObj.code = "424"; conf_ResponseMessageObj.status = "Error"; conf_ResponseMessageObj.message = "No reg unionid"; HttpContext.Response.StatusCode = 424; return(Json(conf_ResponseMessageObj)); } else { string sessionID = HttpContext.Session.Id.ToString(); HttpContext.Session.SetString("guid", orm_Conf_All_Users_Selected.guid); HttpContext.Session.SetString("regdt", DateTime.Now.ToString()); HttpContext.Session.SetString("openid", orm_Conf_All_Users_Selected.openid); HttpContext.Response.Cookies.Append("guid", orm_Conf_All_Users_Selected.guid); return(Json(orm_Conf_All_Users_Selected)); } } }
public ActionResult Action(string script) { Conf_ResponseMessage conf_ResponseMessageObj; try { dbConnection.Execute(script); conf_ResponseMessageObj = new Conf_ResponseMessage(); conf_ResponseMessageObj.code = "200"; conf_ResponseMessageObj.status = "ok"; conf_ResponseMessageObj.message = "Executed"; HttpContext.Response.StatusCode = 200; return(Json(conf_ResponseMessageObj)); } catch { conf_ResponseMessageObj = new Conf_ResponseMessage(); conf_ResponseMessageObj.code = "451"; conf_ResponseMessageObj.status = "Error"; conf_ResponseMessageObj.message = "Not Executed."; HttpContext.Response.StatusCode = 451; return(Json(conf_ResponseMessageObj)); } }
public ActionResult action(string username, string password) { Orm_lst_access_ids lstAccessObj = new Orm_lst_access_ids(); lstAccessObj.username = username; string strQuery = "select * from lst_access_ids where username=@username"; Orm_lst_access_ids exsitedAccessObj = (Orm_lst_access_ids)dbConnection.Query(strQuery, lstAccessObj).Single(); Conf_ResponseMessage conf_ResponseMessageObj; if (exsitedAccessObj == null) { conf_ResponseMessageObj = new Conf_ResponseMessage(); conf_ResponseMessageObj.code = "451"; conf_ResponseMessageObj.status = "Error"; conf_ResponseMessageObj.message = "User not Existed"; HttpContext.Response.StatusCode = 451; return(Json(conf_ResponseMessageObj)); } else { if (exsitedAccessObj.password == password) { string strHost = HttpContext.Request.Host.Host; string appid = exsitedAccessObj.appid; Orm_lst_access_domains orm_Lst_Access_Domains = new Orm_lst_access_domains(); orm_Lst_Access_Domains.appid = appid; strQuery = "select * from lst_access_domains where appid=@appid"; Orm_lst_access_domains existedLstAccessDoaminsObj = (Orm_lst_access_domains)dbConnection.Query(strQuery, orm_Lst_Access_Domains).Single(); if (existedLstAccessDoaminsObj != null) { if (orm_Lst_Access_Domains.changedtimes <= 10) { orm_Lst_Access_Domains.changedtimes++; orm_Lst_Access_Domains.domains = strHost; strQuery = "update lst_access_domains set domains=@domains where appid=@appid"; dbConnection.Execute(strQuery); conf_ResponseMessageObj = new Conf_ResponseMessage(); conf_ResponseMessageObj.code = "200"; conf_ResponseMessageObj.status = "OK"; conf_ResponseMessageObj.message = "updated"; HttpContext.Response.StatusCode = 200; return(Json(conf_ResponseMessageObj)); } else { conf_ResponseMessageObj = new Conf_ResponseMessage(); conf_ResponseMessageObj.code = "451"; conf_ResponseMessageObj.status = "Error"; conf_ResponseMessageObj.message = "Changed Over Limited"; HttpContext.Response.StatusCode = 451; return(Json(conf_ResponseMessageObj)); } } else { orm_Lst_Access_Domains.changedtimes = 1; orm_Lst_Access_Domains.domains = strHost; strQuery = "insert into lst_access_domains(appid,domains,changedtimes) value(@appid,@domains,@changedtimes)"; dbConnection.Execute(strQuery, orm_Lst_Access_Domains); conf_ResponseMessageObj = new Conf_ResponseMessage(); conf_ResponseMessageObj.code = "200"; conf_ResponseMessageObj.status = "OK"; conf_ResponseMessageObj.message = "updated"; HttpContext.Response.StatusCode = 200; return(Json(conf_ResponseMessageObj)); } } else { conf_ResponseMessageObj = new Conf_ResponseMessage(); conf_ResponseMessageObj.code = "451"; conf_ResponseMessageObj.status = "Error"; conf_ResponseMessageObj.message = "Invalidated Password"; HttpContext.Response.StatusCode = 451; return(Json(conf_ResponseMessageObj)); } } }
public ActionResult Action(string data) { Global.GlobalTestingLog globalTestingLog = new Global.GlobalTestingLog("SetConfAllOrdersNew"); try { if (string.IsNullOrEmpty(data)) { Conf_ResponseMessage conf_ResponseMessageObj = new Conf_ResponseMessage(); conf_ResponseMessageObj.code = "500"; conf_ResponseMessageObj.status = "error"; conf_ResponseMessageObj.message = "faild to execute"; HttpContext.Response.StatusCode = 500; return(Json(conf_ResponseMessageObj)); } else { JC_ConfAllOrders jC_ConfAllOrders = (JC_ConfAllOrders)JsonConvert.DeserializeObject(data, typeof(JC_ConfAllOrders)); string query = ""; double totalprice = 0.0; string orderid = Guid.NewGuid().ToString(); foreach (JC_ConfAllOrders_Item shopingcartitem in jC_ConfAllOrders.items) { totalprice = totalprice + shopingcartitem.price; if (shopingcartitem.shopcartid != null && shopingcartitem.shopcartid > 0) { query = "delete from conf_all_shopcart where id=" + shopingcartitem.shopcartid; dbConnection.Execute(query); } query = "insert into conf_all_orders_proitems(proid,orderid,count,modell1,modell2) values(" + shopingcartitem.proid + ",'" + orderid + "'," + shopingcartitem.count + ",'" + shopingcartitem.modell1 + "','" + shopingcartitem.modell2 + "')"; dbConnection.Execute(query); } string cdt = DateTime.Now.ToString("yyyyMMdd"); query = "insert into conf_all_orders(orderid,payed,cdt,returned,addressid,guid,totalprice,shiped,status) values('" + orderid + "','0','" + cdt + "','0','" + jC_ConfAllOrders.addressid + "','" + jC_ConfAllOrders.guid + "'," + totalprice + ",'0','1')"; dbConnection.Execute(query); Orm.Orm_conf_all_address orm_Conf_All_Address = new Orm.Orm_conf_all_address(); query = "select * from conf_all_address where id=" + jC_ConfAllOrders.addressid; orm_Conf_All_Address = dbConnection.Query <Orm.Orm_conf_all_address>(query).FirstOrDefault(); if (orm_Conf_All_Address != null) { Orm.Orm_conf_all_orders_address orm_conf_all_orders_address = new Orm.Orm_conf_all_orders_address(); orm_conf_all_orders_address.guid = orm_Conf_All_Address.guid; orm_conf_all_orders_address.name = orm_Conf_All_Address.name; orm_conf_all_orders_address.country = orm_Conf_All_Address.country; orm_conf_all_orders_address.city = orm_Conf_All_Address.city; orm_conf_all_orders_address.state = orm_Conf_All_Address.state; orm_conf_all_orders_address.district = orm_Conf_All_Address.district; orm_conf_all_orders_address.address = orm_Conf_All_Address.address; orm_conf_all_orders_address.phone = orm_Conf_All_Address.phone; orm_conf_all_orders_address.orderid = orderid; query = "insert into conf_all_orders_address(orderid,guid,name,country,state,city,district,address,phone) values(@orderid,@guid,@name,@country,@state,@city,@district,@address,@phone)"; dbConnection.Execute(query, orm_conf_all_orders_address); } Conf_ResponseMessage conf_ResponseMessageObj = new Conf_ResponseMessage(); conf_ResponseMessageObj.code = "200"; conf_ResponseMessageObj.status = "OK"; conf_ResponseMessageObj.message = orderid; HttpContext.Response.StatusCode = 200; return(Json(conf_ResponseMessageObj)); } } catch (Exception err) { globalTestingLog.AddRecord("stace", err.StackTrace); globalTestingLog.AddRecord("msg", err.Message); Conf_ResponseMessage conf_ResponseMessageObj = new Conf_ResponseMessage(); conf_ResponseMessageObj.code = "500"; conf_ResponseMessageObj.status = "error"; conf_ResponseMessageObj.message = "User existed."; HttpContext.Response.StatusCode = 500; return(Json(conf_ResponseMessageObj)); } }
public ActionResult Action(int id) { JC_ProductItemDetail newitem = new JC_ProductItemDetail(); string query = "select * from conf_all_proitems where id=" + id.ToString(); Orm.Orm_conf_all_proitems Orm_conf_all_proitem = dbConnection.Query <Orm.Orm_conf_all_proitems>(query).FirstOrDefault(); if (Orm_conf_all_proitem == null) { Conf_ResponseMessage conf_ResponseMessageObj = new Conf_ResponseMessage(); conf_ResponseMessageObj.code = "501"; conf_ResponseMessageObj.status = "Error"; conf_ResponseMessageObj.message = "Product is not existed."; HttpContext.Response.StatusCode = 200; return(Json(conf_ResponseMessageObj)); } else { newitem.proid = Orm_conf_all_proitem.id; newitem.title = Orm_conf_all_proitem.title; newitem.des = Orm_conf_all_proitem.des; newitem.materials = Orm_conf_all_proitem.materials; newitem.area = Orm_conf_all_proitem.area; newitem.imglist = new List <string>(); query = "select * from conf_all_proitems_imgs where proid=" + newitem.proid; List <Orm.Orm_conf_all_proitems_imgs> orm_Conf_All_Proitems_Imgs = dbConnection.Query <Orm.Orm_conf_all_proitems_imgs>(query).ToList(); if (orm_Conf_All_Proitems_Imgs != null) { foreach (Orm.Orm_conf_all_proitems_imgs orm_Conf_All_Proitems_Imgs_tmp in orm_Conf_All_Proitems_Imgs) { if (orm_Conf_All_Proitems_Imgs_tmp.titleimg == "0") { newitem.imglist.Add(orm_Conf_All_Proitems_Imgs_tmp.imgpath); } } } query = "select * from conf_all_proitems_store where proid=" + newitem.proid; //Orm.Orm_conf_all_proitems_store orm_Conf_All_Proitems_Store = dbConnection.Query<Orm.Orm_conf_all_proitems_store>(query).First(); List <Orm.Orm_conf_all_proitems_store> lstOrmConfallproitemsstore = dbConnection.Query <Orm.Orm_conf_all_proitems_store>(query).ToList(); if (lstOrmConfallproitemsstore != null) { newitem.jC_ProductItemDetail_Store = new List <JC_ProductItemDetail_Store>(); foreach (Orm.Orm_conf_all_proitems_store orm_Conf_All_Proitems_Store in lstOrmConfallproitemsstore) { JC_ProductItemDetail_Store jC_ProductItemDetail_Store_Item = new JC_ProductItemDetail_Store(); jC_ProductItemDetail_Store_Item.stock = orm_Conf_All_Proitems_Store.stock; if (orm_Conf_All_Proitems_Store.stock > 0) { jC_ProductItemDetail_Store_Item.outofstock = "0"; } else { jC_ProductItemDetail_Store_Item.outofstock = "1"; } jC_ProductItemDetail_Store_Item.modell1 = orm_Conf_All_Proitems_Store.modell1; jC_ProductItemDetail_Store_Item.modell2 = orm_Conf_All_Proitems_Store.modell2; jC_ProductItemDetail_Store_Item.sales = orm_Conf_All_Proitems_Store.sale; query = "select * from conf_all_proitems_price where proid=" + Orm_conf_all_proitem.id + " and modell1='" + jC_ProductItemDetail_Store_Item.modell1 + "' and modell2='" + jC_ProductItemDetail_Store_Item.modell2 + "'"; List <Orm.Orm_conf_all_proitems_price> orm_Conf_All_Proitems_Price = dbConnection.Query <Orm.Orm_conf_all_proitems_price>(query).ToList(); if (orm_Conf_All_Proitems_Price != null) { jC_ProductItemDetail_Store_Item.basicprice = orm_Conf_All_Proitems_Price[0].basic; jC_ProductItemDetail_Store_Item.price = orm_Conf_All_Proitems_Price[0].discount > 0 ? orm_Conf_All_Proitems_Price[0].basic * (orm_Conf_All_Proitems_Price[0].discount / 100.0) : orm_Conf_All_Proitems_Price[0].basic; } else { jC_ProductItemDetail_Store_Item.basicprice = 0; jC_ProductItemDetail_Store_Item.price = 0; } newitem.jC_ProductItemDetail_Store.Add(jC_ProductItemDetail_Store_Item); } } newitem.infoimgs = new Dictionary <string, string>(); query = "select * from conf_all_proitems_imginfo where proid=" + newitem.proid; List <Orm.Orm_conf_all_proitems_imginfo> orm_Conf_All_Proitems_Imginfos = dbConnection.Query <Orm.Orm_conf_all_proitems_imginfo>(query).ToList(); foreach (Orm.Orm_conf_all_proitems_imginfo orm_Conf_All_Proitems_Imginfo_tmp in orm_Conf_All_Proitems_Imginfos) { if (!newitem.infoimgs.ContainsKey(orm_Conf_All_Proitems_Imginfo_tmp.index.ToString())) { newitem.infoimgs.Add(orm_Conf_All_Proitems_Imginfo_tmp.index.ToString(), orm_Conf_All_Proitems_Imginfo_tmp.img); } } return(Json(newitem)); } }