/// <summary> /// 확인 버튼 클릭시 발생하는 이벤트 /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void btn_ok_Click(object sender, EventArgs e) { string type_u = "seller"; Seller_Vo sv_sub = new Seller_Vo() { Seller_NO = Int32.Parse(lbl_No.Text), Seller_state = s_s, Join_state = j_s }; if (!sv.Equals(sv_sub)) { var result = MessageBox.Show("수정 하시겠습니까?", "수정", MessageBoxButtons.OKCancel, MessageBoxIcon.Warning); if (result == DialogResult.OK) { if (new Admin_Dao().Update_state_ob(sv_sub, type_u)) { MessageBox.Show("수정 성공"); Admin_main ad = (Admin_main)Owner; ad.Pro_Temp = true; } } else { seller_Detail_Load(null, null); } } Close(); }
/// <summary> /// 업데이트 문을 처리 하기 위한 메서드 /// </summary> /// <param name="ob_sub"></param> /// <param name="type_u"></param> /// <returns></returns> internal bool Update_state_ob(object ob_sub, string type_u) { SqlParameter[] sqlParameters = new SqlParameter[0]; string sp = ""; if (type_u == "seller") { Seller_Vo sv_sub = ob_sub as Seller_Vo; sp = "update_seller_join_state"; //var con = new DBCon_admin(); sqlParameters = new SqlParameter[3]; sqlParameters[0] = new SqlParameter("seller_no", sv_sub.Seller_NO); sqlParameters[1] = new SqlParameter("join_state", sv_sub.Join_state); sqlParameters[2] = new SqlParameter("seller_state", sv_sub.Seller_state); } else if (type_u == "pro") { Products_Vo pv_sub = ob_sub as Products_Vo; sp = "update_products_state"; sqlParameters = new SqlParameter[2]; sqlParameters[0] = new SqlParameter("pro_ID", pv_sub.Pro_ID); sqlParameters[1] = new SqlParameter("pro_state", pv_sub.Pro_State); } else if (type_u == "pay") { TaxBill_Vo tv_sub = ob_sub as TaxBill_Vo; sp = "update_pay_tax_date"; sqlParameters = new SqlParameter[1]; sqlParameters[0] = new SqlParameter("pay_id", tv_sub.Pay_ID); } else if (type_u == "inq") { Inquire_Admin_Vo ia_sub = ob_sub as Inquire_Admin_Vo; sp = "update_Inquire_Admin"; sqlParameters = new SqlParameter[2]; sqlParameters[0] = new SqlParameter("inquire_no", ia_sub.Inquire_no); sqlParameters[1] = new SqlParameter("re_body", ia_sub.Re_body); } try { return(new DBCon_admin().Update_ob(sp, sqlParameters)); } catch (Exception) { throw; } }
/// <summary> /// select 문을 처리 하기 위한 메서드 /// </summary> /// <param name="sp"></param> /// <param name="type_p"></param> /// <returns></returns> internal List <object> Select_ob(string sp, string type_p) { SqlConnection sqlCon = OpenCon(); var cmd = GetCommand(sqlCon, sp, null, null); try { var sdr = cmd.ExecuteReader(); if (type_p == "pro") { while (sdr.Read()) { Products_Vo pv = new Products_Vo(); { pv.Pro_ID = sdr["pro_Id"].ToString(); pv.Cat_ID = sdr["cat_id"].ToString(); pv.Seller_NO = Int32.Parse(sdr["seller_no"].ToString()); pv.Pro_Name = sdr["pro_name"].ToString(); //pv.Pro_Price = Int32.Parse(sdr["pro_price"].ToString()); int Pro_Price = Int32.Parse(sdr["pro_price"].ToString()); pv.Pro_Price = Pro_Price.ToString("#,##0"); pv.Main_Comment = sdr["main_comment"].ToString(); pv.Sub_Comment = sdr["sub_comment"].ToString(); pv.Main_Image = sdr["main_image"].ToString(); pv.Pro_Hits = Int32.Parse(sdr["pro_hits"].ToString()); pv.Pro_Like = Int32.Parse(sdr["pro_like"].ToString()); pv.Pro_Discount = Int32.Parse(sdr["pro_discount"].ToString()); pv.Pro_Gender = sdr["pro_gender"].ToString(); pv.Pro_State = bool.Parse(sdr["pro_state"].ToString()); pv.Pro_Url = sdr["pro_Url"].ToString(); } ob_lst.Add(pv); //pro_lst.Add(pv); } } else if (type_p == "cus") { while (sdr.Read()) { ob_lst.Add(new Customers_Vo() { Cus_no = Int32.Parse(sdr["cus_no"].ToString()), Cus_ID = sdr["cus_id"].ToString(), Cus_pwd = sdr["cus_pwd"].ToString(), Cus_phone = sdr["cus_phone"].ToString(), Cus_addr = sdr["cus_addr"].ToString(), Cus_name = sdr["cus_name"].ToString(), Cus_Nickname = sdr["cus_nickname"].ToString(), Cus_gender = bool.Parse(sdr["cus_gender"].ToString()), Cus_state = bool.Parse(sdr["cus_state"].ToString()), Cus_count = Int32.Parse(sdr["cus_count"].ToString()), Cus_age = Int32.Parse(sdr["cus_age"].ToString()), Join_date = DateTime.Parse(sdr["join_date"].ToString()), Withdrawal_date = sdr["Withdrawal_date"].ToString() //(sdr["Withdrawal_date"].ToString() =="") ? "" : DateTime.Parse(sdr["Withdrawal_date"].ToString()) }); } } else if (type_p == "sel") // type-p = "sel" { while (sdr.Read()) { Seller_Vo sv = new Seller_Vo(); { sv.Seller_NO = Int32.Parse(sdr["seller_no"].ToString()); sv.Seller_ID = sdr["seller_id"].ToString(); sv.Seller_pwd = sdr["seller_pwd"].ToString(); sv.Seller_name = sdr["seller_name"].ToString(); sv.Seller_addr = sdr["seller_addr"].ToString(); sv.Seller_boss = sdr["seller_boss"].ToString(); sv.Seller_phone = sdr["seller_phone"].ToString(); sv.Seller_postal = sdr["seller_postal"].ToString(); sv.Seller_email = sdr["seller_email"].ToString(); sv.Seller_fax = sdr["seller_fax"].ToString(); sv.Return_addr = sdr["return_addr"].ToString(); sv.Seller_state = bool.Parse(sdr["seller_state"].ToString()); sv.Corporate_registration_no = sdr["Corporate_registration_no"].ToString(); sv.Join_state = bool.Parse(sdr["join_state"].ToString()); } ob_lst.Add(sv); } } else if (type_p == "pay") { while (sdr.Read()) { ob_lst.Add(new TaxBill_Vo() { Pay_ID = Int32.Parse(sdr["pay_id"].ToString()), Corporate_registration_no = sdr["Corporate_registration_no"].ToString(), Output_date_tax = sdr["Output_date_tax"].ToString(), Pay_count = Int32.Parse(sdr["Pay_count"].ToString()), Pay_date = sdr["Pay_date"].ToString(), Pay_price = Int32.Parse(sdr["Pay_price"].ToString()).ToString("#,##0"), Seller_boss = sdr["Seller_boss"].ToString(), Seller_ID = sdr["Seller_ID"].ToString(), Stock_ID = sdr["Stock_ID"].ToString(), Seller_addr = sdr["seller_addr"].ToString() }); } } else if (type_p == "inq") { if (sp == "select_sel_inq") { while (sdr.Read()) { ob_lst.Add(new Inquire_Admin_Vo() { Inquire_email = sdr["seller_email"].ToString(), Inquire_name = sdr["seller_ID"].ToString(), Cus_or_sell = sdr["cus_or_sell"].ToString(), Inquire_body = sdr["inquire_body"].ToString(), Inquire_date = sdr["inquire_date"].ToString(), Cus_no = 0, Seller_no = Int32.Parse(sdr["seller_no"].ToString()), Inquire_image = sdr["inquire_image"].ToString(), Inquire_no = Int32.Parse(sdr["inquire_no"].ToString()), Inquire_title = sdr["inquire_title"].ToString(), Inquire_type = sdr["inquire_type"].ToString(), Re_body = sdr["re_body"].ToString(), Re_date = sdr["re_date"].ToString() }); } } else if (sp == "select_cus_inq") { while (sdr.Read()) { ob_lst.Add(new Inquire_Admin_Vo() { Inquire_email = sdr["cus_id"].ToString(), Inquire_name = sdr["cus_nickname"].ToString(), Cus_or_sell = sdr["cus_or_sell"].ToString(), Inquire_body = sdr["inquire_body"].ToString(), Inquire_date = sdr["inquire_date"].ToString(), Cus_no = Int32.Parse(sdr["cus_no"].ToString()), Seller_no = 0, Inquire_image = sdr["inquire_image"].ToString(), Inquire_no = Int32.Parse(sdr["inquire_no"].ToString()), Inquire_title = sdr["inquire_title"].ToString(), Inquire_type = sdr["inquire_type"].ToString(), Re_body = sdr["re_body"].ToString(), Re_date = sdr["re_date"].ToString() }); } } } else if (type_p == "sal") { while (sdr.Read()) { ob_lst.Add(new Sales_manager_Vo() { Seller_ID = sdr["seller_id"].ToString(), Pay_date = sdr["pay_date"].ToString(), Pay_date_m = sdr["pay_date"].ToString().Substring(sdr["pay_date"].ToString().IndexOf("-") + 1, 2), Pay_count = Int32.Parse(sdr["pay_count"].ToString()), Pay_price = Int32.Parse(sdr["Pay_price"].ToString()) }); } } else if (type_p == "dashboard") { while (sdr.Read()) { ob_lst.Add(sdr["count"]); } } } catch (SqlException) { throw; } finally { sqlCon.Close(); } return(ob_lst); }
public Seller_Detail(object sv) : this() { this.sv = (Seller_Vo)sv; }