protected void Button2_Click(object sender, EventArgs e) { //const int para = 2; try { #region old //string cardnbr = "", usermodify = ""; //usermodify = (string)Session["Username"]; //cardnbr = tbSoThe.Text.Trim(); //if (cardnbr != "") //{ // //cardnbr in varchar2, // //usermodify in varchar2, // //Result_out out number, // //Emsg_out out varchar2 // int i = 0; // string name = "" + executedb.owner + "proc_unlock_pin"; // string[] InParaName = new string[2] { "cardnbr", "usermodify" }; // string[] OutParaName = new string[para] { "Result_out", "Emsg_out" }; // OracleType[] InParaType = new OracleType[2] { OracleType.VarChar, OracleType.VarChar }; // OracleType[] OutParaType = new OracleType[para] { // OracleType.Number, // OracleType.VarChar // //OracleType.Number // }; // string[] InParaValues = new string[2] { cardnbr, usermodify }; // string[] OutParaValues = new string[para]; // for (i = 0; i < para; i++) // OutParaValues[i] = ""; // int[] OutParaSize = new int[para] { // 0, // 200 // }; // string err = ""; // executedb.ExecuteProc(name, InParaName, InParaType, InParaValues, OutParaName, OutParaType, OutParaSize, ref OutParaValues, ref err); // if (err != "") // { // executedb.WriteLogERROR(Session["Username"].ToString(), "IP: " + Request.UserHostAddress, this.Page.ToString(), System.Reflection.MethodBase.GetCurrentMethod().ToString(), "" + executedb.owner + "proc_close_card" + " --> " + err); // //executedb.WriteLogPri(Environment.NewLine + DateTime.Now.ToLongDateString() + " " + DateTime.Now.ToLongTimeString() + " - " + Session["Username"].ToString() + ": " + sql + Environment.NewLine + err1); // //Response.Write("<script>alert('Error when executing from database!!!')</script>"); // Alert.Show("Error when executing from database!!!", this); // //executedb.WriteLogPri(Environment.NewLine + DateTime.Now.ToLongDateString() + " " + DateTime.Now.ToLongTimeString() + " - " + Session["Username"].ToString() + ": " + ""+ executedb.owner + "proc_nabcustomercarecredit" + " --> " + err); // ////Response.Write("<script>alert('Error when executing from database!!!')</script>"); // //Alert.Show("Error when executing from database!!!", this); // } // else // { // if (OutParaValues[1].ToString() == "-1") // { // executedb.WriteLogERROR(Session["Username"].ToString(), "IP: " + Request.UserHostAddress, this.Page.ToString(), System.Reflection.MethodBase.GetCurrentMethod().ToString(), "" + executedb.owner + "proc_unlock_pin" + " --> " + " --> " + err + Environment.NewLine + "Error Code: " + OutParaValues[1].ToString()); // Alert.Show("Error when executing from database!!! Error Code:" + OutParaValues[1].ToString(), this); // } // else // { // Alert.Show("Đã thực hiện mở khóa PIN thành công cho thẻ: " + tbSoThe.Text, this); // executedb.WriteLogINFO(Session["Username"].ToString(), "IP: " + Request.UserHostAddress, this.Page.ToString(), System.Reflection.MethodBase.GetCurrentMethod().ToString(), " Mở khóa PIN thành công cho thẻ: " + tbSoThe.Text); // } // LoadData(); // } //} #endregion conTTTSOA reset = new conTTTSOA(); string sothe = tbSoThe.Text.Trim(); string result = ""; result = reset.SOA_Reset_Pin("WEB", sothe, "82"); int s_rs = 8, e_rs = result.IndexOf("</result>"), s_msg = result.IndexOf("<msg>"), e_msg = result.IndexOf("</msg>"); //Alert.Show(result.Substring(s_rs, e_rs - 8) + "___" + result.Substring(s_msg + 5, e_msg - s_msg - 5), this); if (result.Substring(s_rs, e_rs - 8) == "0") { Alert.Show("Thành công! Số thẻ: " + tbSoThe.Text.Trim(), this); } else { Alert.Show("Lỗi: " + result.Substring(s_rs, e_rs - 8) + " - " + result.Substring(s_msg + 5, e_msg - s_msg - 5), this); } } catch (Exception ex) { Alert.Show("Error from coding .....\\n", this); executedb.WriteLogERROR(Session["Username"].ToString(), "IP: " + Request.UserHostAddress, this.Page.ToString(), System.Reflection.MethodBase.GetCurrentMethod().ToString(), ex.Message); //executedb.WriteLogPri(Environment.NewLine + DateTime.Now.ToLongDateString() + " " + DateTime.Now.ToLongTimeString() + " - " + Session["Username"].ToString() + ": " + Environment.NewLine + ex.Message); } }
protected void Button2_Click(object sender, EventArgs e) { //const int para = 2; try { conTTTSOA kichhoat = new conTTTSOA(); string sothe = tbSoThe.Text.Trim(); string result = ""; string userid = (string)Session["Username"]; if (userid == "") { ScriptManager.RegisterStartupScript ( this.Page, this.Page.GetType ( ), "err_msg", "alert('Please log on again !!');window.location='../Default.aspx';", true ); return; } result = kichhoat.SOA_Delivery_Card("WEB", sothe, "82"); int s_rs = 8, e_rs = result.IndexOf("</result>"), s_msg = result.IndexOf("<msg>"), e_msg = result.IndexOf("</msg>"); //Alert.Show(result.Substring(s_rs, e_rs - 8) + "___" + result.Substring(s_msg + 5, e_msg - s_msg - 5), this); if (result.Substring(s_rs, e_rs - 8) == "0") { string sql = "", err = ""; sql = " insert into nab_staff_process_logs_new "; sql += " (function_type,table_name,tag_value,user_create,date_create)"; sql += " values "; sql += " ('Active Card' , 'SOA' , '" + sothe + "', '" + userid + "',sysdate)"; if (executedb.ExecuteDML ( sql, ref err )) { ScriptManager.RegisterStartupScript ( this.Page, this.Page.GetType ( ), "err_msg", "alert('Success!!!');", true ); return; } else { ScriptManager.RegisterStartupScript ( this.Page, this.Page.GetType ( ), "err_msg", "alert('Insert fail : " + err + "');", true ); return; } } else { Alert.Show("Lỗi: " + result.Substring(s_rs, e_rs - 8) + " - " + result.Substring(s_msg + 5, e_msg - s_msg - 5), this); } } catch (Exception ex) { Alert.Show("Error from coding .....\\n", this); executedb.WriteLogERROR(Session["Username"].ToString(), "IP: " + Request.UserHostAddress, this.Page.ToString(), System.Reflection.MethodBase.GetCurrentMethod().ToString(), ex.Message); //executedb.WriteLogPri(Environment.NewLine + DateTime.Now.ToLongDateString() + " " + DateTime.Now.ToLongTimeString() + " - " + Session["Username"].ToString() + ": " + Environment.NewLine + ex.Message); } }
private void Save() { try { if (tbCardNbr.Text.Trim() == "" || tbCardNbr.Visible == false) { Alert.Show("Chọn khách hàng.", this); return; } string userid = (string)Session["Username"]; if (userid == "") { ScriptManager.RegisterStartupScript ( this.Page, this.Page.GetType ( ), "err_msg", "alert('Please log on again !!');window.location='../Default.aspx';", true ); return; } else { string result = "", cardnum = "", intype = ""; if (cbTinhTrangDangKy.SelectedValue == "1" || cbTinhTrangDangKy.Text == "Đăng ký") { intype = "A"; } else { intype = "I"; } cardnum = tbCardNbr.Text.Trim(); conTTTSOA soa = new conTTTSOA(); result = soa.SOA_Update_ECom_Flag("Web", cardnum, intype, "82"); int s_rs = 8, e_rs = result.IndexOf("</result>"), s_msg = result.IndexOf("<msg>"), e_msg = result.IndexOf("</msg>"); //Alert.Show(result.Substring(s_rs, e_rs - 8) + "___" + result.Substring(s_msg + 5, e_msg - s_msg - 5), this); if (result.Substring(s_rs, e_rs - 8) == "0") { string sql = "", err = ""; sql = " insert into nab_staff_process_logs_new "; sql += " (function_type,table_name,tag_value,user_create,date_create)"; sql += " values "; sql += " ('Ecom Register' , 'SOA' , '" + cardnum + "', '" + userid + "',sysdate)"; if (!executedb.ExecuteDML ( sql, ref err )) { ScriptManager.RegisterStartupScript ( this.Page, this.Page.GetType ( ), "err_msg", "alert('Insert fail : " + err + "');", true ); return; } if (cbTinhTrangDangKy.SelectedValue == "1" || cbTinhTrangDangKy.Text == "Đăng ký") Alert.Show("Đăng kí thành công! Số thẻ: " + cardnum, this); else { Alert.Show("Hủy thành công! Số thẻ: " + cardnum, this); } } else { Alert.Show("Lỗi: " + result.Substring(s_rs, e_rs - 8) + " - " + result.Substring(s_msg + 5, e_msg - s_msg - 5), this); } } } catch { } }
protected void bt_Autho_Click(object sender, EventArgs e) { if (tb_Acc.Text.Trim() != "") { string usercreate = "", nqh_code = "", account = "", profile = "", content = ""; string[] event_code = cbNhomNo.SelectedValue.ToString().Split('|'); content = cbNhomNo.Text; usercreate = (string)Session["Username"]; account = tb_Acc.Text.Trim(); profile = tb_ProfileCode.Text; try { if (rbproc.Checked) { Alert.Show("Không chọn chức năng này !!! ", this); /* Tam Hide lai phan chon Proc*/ //nqh_code = event_code[1]; //content = event_code[0]; //string id = getAccountID(account); //if (id != "") //{ // if (profile.Trim() == "") // { // executedb.WriteLogERROR(Session["Username"].ToString(), "IP: " + Request.UserHostAddress, this.Page.ToString(), System.Reflection.MethodBase.GetCurrentMethod().ToString(), "Can not get Profile Code for account:" + account); // Alert.Show("Error when get profile code for account:" + account, this); // return; // } // int i = 0; // string name = "CALL_EVENT"; // string[] InParaName = new string[3] { "Contract_ID", "EVENT_ID", "CONTENT" }; // OracleType[] InParaType = new OracleType[3] { OracleType.Number, OracleType.Number, OracleType.VarChar }; // string[] InParaValues = new string[3] { id, nqh_code, content }; // string[] OutParaName = new string[1] { "Emsg_out" }; // OracleType[] OutParaType = new OracleType[1] { OracleType.VarChar }; // int[] OutParaSize = new int[1] { 200 }; // string[] OutParaValues = new string[1] {""}; // string err = ""; // executedb.ExecuteProc(name, InParaName, InParaType, InParaValues, OutParaName, OutParaType, OutParaSize, ref OutParaValues, ref err); // if (err != "") // { // executedb.WriteLogERROR(Session["Username"].ToString(), "IP: " + Request.UserHostAddress, this.Page.ToString(), System.Reflection.MethodBase.GetCurrentMethod().ToString(), "" + executedb.owner + "CALL_EVENT" + " --> " + err); // Alert.Show("Error when executing from database!!!", this); // } // else // { // if (OutParaValues[0].ToString().Substring(0,2) != "OK") // { // update_data(id, content, usercreate, "0", "Y"); // Visible(); // LoadGrid("N"); // executedb.WriteLogERROR(Session["Username"].ToString(), "IP: " + Request.UserHostAddress, this.Page.ToString(), System.Reflection.MethodBase.GetCurrentMethod().ToString(), "" + executedb.owner + "CALL_EVENT" + " --> " + " --> " + err + Environment.NewLine + "Error Code: " + OutParaValues[0].ToString()); // Alert.Show("Error when executing from database!!! Error Code:" + OutParaValues[0].ToString(), this); // } // else // { // update_data(id, content, usercreate, "1", "Y"); // Visible(); // LoadGrid("N"); // bt_Autho.Enabled = false; // Alert.Show("Duyệt thành công !!! ", this); // executedb.WriteLogINFO(Session["Username"].ToString(), "IP: " + Request.UserHostAddress, this.Page.ToString(), System.Reflection.MethodBase.GetCurrentMethod().ToString(), "Chuyen nhom no thanh cong cho tai khoan: " + account); // } // } //} } else if (rbSOA.Checked) { string result = "", err = "" ; nqh_code = event_code[0]; if (err != "") { Alert.Show(err); } else { conTTTSOA soa = new conTTTSOA(); result = soa.SOA_Update_OVD("Web", account, nqh_code, "86"); int s_rs = 8, e_rs = result.IndexOf("</result>"), s_msg = result.IndexOf("<msg>"), e_msg = result.IndexOf("</msg>"); if (result.Substring(s_rs, e_rs - 8) == "0") { update_data(getAccountID(account), nqh_code, usercreate, "1", "Y"); Alert.Show("Duyệt thành công !!!", this); LoadGrid("N"); Visible(); } else { update_data(getAccountID(account), nqh_code, usercreate, "0", "Y"); Alert.Show("Thực hiện chuyển nhóm nợ đã lỗi!", this); } } } } catch (Exception ex) { #region logException executedb.WriteLogERROR(Session["Username"].ToString(), "IP: " + Request.UserHostAddress, this.Page.ToString(), System.Reflection.MethodBase.GetCurrentMethod().ToString(), ex.Message); Alert.Show("Error when executing coding!!!", this); #endregion logException } } }
protected void Button3_Click(object sender, EventArgs e) { //Save(); //old try { string userid = (string)Session["Username"]; if (userid == "") { ScriptManager.RegisterStartupScript ( this.Page, this.Page.GetType ( ), "err_msg", "alert('Please log on again !!');window.location='../Default.aspx';", true ); return; } string in_cr_account_nbr = "", in_autopayment_acc = "", AUTO_PAYMENT_FLAG = ""; in_autopayment_acc = tbAC_Auto_payment.Text; if (cbAuto_payment.Text.Trim().ToUpper() == "NONE") { AUTO_PAYMENT_FLAG = "000"; } else { if (cbAuto_payment.Text.Trim().ToUpper() == "MIN DUE")// || cbAuto_payment.Text.Trim().ToUpper() == "Full Payment".ToUpper()) { AUTO_PAYMENT_FLAG = "M"; } else { if (cbAuto_payment.Text.Trim().ToUpper() == "Full Payment".ToUpper()) AUTO_PAYMENT_FLAG = "100"; else { if (cbAuto_payment.Text.Trim().ToUpper() == "Percentage".ToUpper()) { if (tbPercent_Auto_payment.Text.Trim() == "") { Alert.Show("Please input percent to auto_payment!!!", this); return; } else { try { if (Convert.ToInt16(tbPercent_Auto_payment.Text.Trim()) > 100 || Convert.ToInt16(tbPercent_Auto_payment.Text.Trim()) < 0) { Alert.Show("Percent not corect!!!", this); return; } else { if (Convert.ToInt16(tbPercent_Auto_payment.Text.Trim()) < 10) AUTO_PAYMENT_FLAG = "00" + tbPercent_Auto_payment.Text.Trim(); else { if (Convert.ToInt16(tbPercent_Auto_payment.Text.Trim()) >= 10 && Convert.ToInt16(tbPercent_Auto_payment.Text.Trim()) < 100) { AUTO_PAYMENT_FLAG = "0" + tbPercent_Auto_payment.Text.Trim(); } else AUTO_PAYMENT_FLAG = tbPercent_Auto_payment.Text.Trim(); } } } catch { Alert.Show("Percent not corect!!!", this); return; } } } } } } string sql = "", err = ""; sql += "select ca.contract_number "; sql += "from " + executedb.owner + "acnt_contract ca "; sql += "where 1 = 1 "; sql += " and ca.amnd_state ='A' "; sql += " and ca.id = (select c.acnt_contract__oid "; sql += " from " + executedb.owner + "acnt_contract c "; sql += " where 1 = 1 "; sql += " and c.amnd_state = 'A' "; sql += " and c.con_cat = 'C' "; sql += " and c.contract_number = '" + tbCardNbr.Text.Trim() + "') "; DataTable issdt = executedb.getTable(sql, ref err); if (err != "") { Alert.Show("Error: " + err, this); return; } else { if (issdt.Rows.Count > 0) { in_cr_account_nbr = issdt.Rows[0][0].ToString().Trim(); } else { Alert.Show("Không tìm thấy Số tài khoản cho thẻ này!", this); return; } } conTTTSOA autopm = new conTTTSOA(); string result = ""; result = autopm.SOA_Update_Autopayment("Web", in_cr_account_nbr, in_autopayment_acc,AUTO_PAYMENT_FLAG, "82"); int s_rs = 8, e_rs = result.IndexOf("</result>"), s_msg = result.IndexOf("<msg>"), e_msg = result.IndexOf("</msg>"); if (result.Substring(s_rs, e_rs - 8) == "0") { sql = " insert into nab_staff_process_logs_new "; sql += " (function_type,table_name,tag_value,user_create,date_create)"; sql += " values "; sql += " ('Update Auto Payment' , 'SOA' , '" + in_cr_account_nbr + "', '" + userid + "',sysdate)"; if (executedb.ExecuteDML ( sql, ref err )) { ScriptManager.RegisterStartupScript ( this.Page, this.Page.GetType ( ), "err_msg", "alert('Thành công! Số thẻ: " + tbCardNbr.Text.Trim ( ) + "');", true ); return; } else { ScriptManager.RegisterStartupScript ( this.Page, this.Page.GetType ( ), "err_msg", "alert('Insert fail : " + err + "');", true ); return; } } else { Alert.Show("Lỗi: " + result.Substring(s_rs, e_rs - 8) + " - " + result.Substring(s_msg + 5, e_msg - s_msg - 5), this); } } catch { } }
private void Save() { try { if (tbCardNbr.Text.Trim() == "" || tbCardNbr.Visible == false) { Alert.Show("Chọn khách hàng.", this); return; } if (Session["Username"].ToString().Trim() == "") { Alert.Show("Ngắt section.Vui lòng đăng nhập lại.", this); return; } else { string result = "", cardnum = "", intype = ""; if (cbVIP.SelectedValue == "0" || cbVIP.Text == "Normal") intype = "N"; else { if (cbVIP.SelectedValue == "1" || cbVIP.Text == "VIP") { intype = "V"; } else { intype = "S"; } } cardnum = tbCardNbr.Text.Trim(); conTTTSOA soa = new conTTTSOA(); result = soa.SOA_Update_Vip_Flag("Web", cardnum, intype, "82"); int s_rs = 8, e_rs = result.IndexOf("</result>"), s_msg = result.IndexOf("<msg>"), e_msg = result.IndexOf("</msg>"); //Alert.Show(result.Substring(s_rs, e_rs - 8) + "___" + result.Substring(s_msg + 5, e_msg - s_msg - 5), this); if (result.Substring(s_rs, e_rs - 8) == "0") { Alert.Show("Thành công! Số thẻ: " + cardnum, this); } else { Alert.Show("Lỗi: " + result.Substring(s_rs, e_rs - 8) + " - " + result.Substring(s_msg + 5, e_msg - s_msg - 5), this); } } } catch { } }
protected void Button2_Click(object sender, EventArgs e) { #region proc_old //const int para = 2; //try //{ // string cardnbr = "", usermodify = ""; // usermodify = (string)Session["Username"]; // string type = ""; // if (rbVanBan.Checked) // { // type = "VB"; // } // else // { // type = "MB"; // } // cardnbr = tbSoThe.Text.Trim(); // if (cardnbr != "") // { // int i = 0; // string name = "" + executedb.owner + "proc_close_card"; // string[] InParaName = new string[3] { "cardnbr", "usermodify", "type" }; // string[] OutParaName = new string[para] { "Result_out", "Emsg_out" }; // OracleType[] InParaType = new OracleType[3] { OracleType.VarChar, OracleType.VarChar, OracleType.VarChar }; // OracleType[] OutParaType = new OracleType[para] { // OracleType.Number, // OracleType.VarChar // }; // string[] InParaValues = new string[3] { cardnbr, usermodify, type }; // string[] OutParaValues = new string[para]; // for (i = 0; i < para; i++) // OutParaValues[i] = ""; // int[] OutParaSize = new int[para] { // 0, // 200 // }; // string err = ""; // executedb.ExecuteProc(name, InParaName, InParaType, InParaValues, OutParaName, OutParaType, OutParaSize, ref OutParaValues, ref err); // if (err != "") // { // executedb.WriteLogERROR(Session["Username"].ToString(), "IP: " + Request.UserHostAddress, this.Page.ToString(), System.Reflection.MethodBase.GetCurrentMethod().ToString(), "" + executedb.owner + "proc_close_card" + " --> " + err); // Alert.Show("Error when executing from database!!!", this); // } // else // { // if (OutParaValues[1].ToString() == "-1") // { // executedb.WriteLogERROR(Session["Username"].ToString(), "IP: " + Request.UserHostAddress, this.Page.ToString(), System.Reflection.MethodBase.GetCurrentMethod().ToString(), "" + executedb.owner + "proc_close_card" + " --> " + " --> " + err + Environment.NewLine + "Error Code: " + OutParaValues[1].ToString()); // Alert.Show("Error when executing from database!!! Error Code:" + OutParaValues[1].ToString(), this); // } // else // { // Alert.Show("Đã thực hiện Khóa thẻ thành công cho thẻ: " + tbSoThe.Text, this); // executedb.WriteLogINFO(Session["Username"].ToString(), "IP: " + Request.UserHostAddress, this.Page.ToString(), System.Reflection.MethodBase.GetCurrentMethod().ToString(), " Đã thực hiện Khóa thẻ thành công cho thẻ: " + tbSoThe.Text); // } // LoadData(); // } // } //} #endregion try { string cardnum = tbSoThe.Text.Trim(); string ten = tbTenKH.Text.Trim(); string result = ""; string userid = (string)Session["Username"]; if (userid == "") { ScriptManager.RegisterStartupScript ( this.Page, this.Page.GetType ( ), "err_msg", "alert('Please log on again !!');window.location='../Default.aspx';", true ); return; } conTTTSOA soa = new conTTTSOA(); result = soa.SOA_Lock_Card("WEB", cardnum, "82"); int s_rs = 8, e_rs = result.IndexOf("</result>"), s_msg = result.IndexOf("<msg>"), e_msg = result.IndexOf("</msg>"); //Alert.Show(result.Substring(s_rs, e_rs - 8) + "___" + result.Substring(s_msg + 5, e_msg - s_msg - 5), this); if (result.Substring(s_rs, e_rs - 8) == "0") { string sql = "", err = ""; sql = " insert into nab_staff_process_logs_new "; sql += " (function_type,table_name,tag_value,user_create,date_create)"; sql += " values "; sql += " ('Lock Card' , 'SOA' , '" + cardnum + "', '" + userid + "',sysdate)"; if (executedb.ExecuteDML ( sql, ref err )) { ScriptManager.RegisterStartupScript ( this.Page, this.Page.GetType ( ), "err_msg", "alert('Success!!!');", true ); return; } else { ScriptManager.RegisterStartupScript ( this.Page, this.Page.GetType ( ), "err_msg", "alert('Insert fail : " + err + "');", true ); return; } } else { Alert.Show("Lỗi: " + result.Substring(s_rs, e_rs - 8) + " - " + result.Substring(s_msg + 5, e_msg - s_msg - 5), this); } } catch (Exception ex) { #region logException executedb.WriteLogERROR(Session["Username"].ToString(), "IP: " + Request.UserHostAddress, this.Page.ToString(), System.Reflection.MethodBase.GetCurrentMethod().ToString(), ex.Message); //executedb.WriteLogPri(Environment.NewLine + DateTime.Now.ToLongDateString() + " " + DateTime.Now.ToLongTimeString() + " - " + Session["Username"].ToString() + ": " + ex.Message); //Response.Write("<script>alert('Error when executing coding')</script>"); Alert.Show("Error when executing coding!!!", this); #endregion logException } }