protected void buttonSaveTicket_Click(object sender, System.EventArgs e) { try { PSP.Ticket t = new PSP.Ticket(); t.tno = Convert.ToInt32(textTicketNo.Text); t.isdn = textISDN.Text; t.imsi = textIMSI.Text; t.procmd = textProCmd.Text; t.duration = (textDuration.Text.Length == 0 ? 0 : Convert.ToInt32(textDuration.Text)); t.op = 0; t.param = textParam.Text; t.host = this.Request.UserHostName; t.billitem = (checkNotBill.Checked ? -1 : 0); t.date = Convert.ToDateTime(textDate.Text); string msg = this.PspProxy.SaveTicket(t); if (msg.Length == 0) { labelStatus.ForeColor = Color.Black; labelStatus.Text = t.tno + " vйлчилгээ амжилттай засагдлаа."; } else { labelStatus.ForeColor = Color.Red; labelStatus.Text = "Vйлчилгээг засахад алдаа гарлаа: " + msg; } } catch (Exception ex) { labelStatus.ForeColor = Color.Red; labelStatus.Text = "Vйлчилгээг засахад алдаа гарлаа: " + ex.Message; } }
protected void buttonAdd_Click(object sender, System.EventArgs e) { if (!this.IsValidISDN(textPhone.Text)) { labelStatus.ForeColor = Color.Red; labelStatus.Text = "Буруу дугаар!"; return; } if (textPhone.Text.Length == 6) textPhone.Text = "99" + textPhone.Text; try { PSP.Ticket t = new PSP.Ticket(); t.tno = 0; t.imsi = ""; t.isdn = textPhone.Text; t.procmd = comboProCmd.SelectedItem.Value; t.duration = (textDuration.Text.Length == 0 ? 0 : Convert.ToInt32(textDuration.Text)); t.param = textParam.Text; t.host = this.Request.UserHostName; t.date = DateTime.Now; t.billitem = 0; if (this.PspProxy.CheckPermission("Provision.ChangeOperator")) { try { t.op = -Convert.ToInt32(comboOperator.SelectedValue); } catch {} } string msg = this.PspProxy.SaveTicket(t, checkForceDup.Checked); if (msg.Length == 0) { labelStatus.CssClass = "caption"; labelStatus.Text = t.isdn + " дугаарын '" + t.procmd + "' vйлчилгээ амжилттай бvртгэгдлээ."; } else { labelStatus.CssClass = "error"; labelStatus.Text = msg; } } catch (Exception ex) { labelStatus.CssClass = "error"; labelStatus.Text = "Vйлчилгээг оруулахад алдаа гарлаа: " + ex; } finally { ClearParams(); } }
protected void buttonManualCorrect_Click(object sender, System.EventArgs e) { try { PSP.Ticket t = new PSP.Ticket(); t.tno = Convert.ToInt32(textTicketNo.Text); t.state = 2; t.result = "Corrected manually by " + this.PspProxy.CurrentOperator.uid; t.applyDate = DateTime.Now; t.tryCount = 1; this.PspProxy.SetTicketResult(t); buttonRefresh_Click(sender, e); } catch (Exception ex) { labelStatus.ForeColor = Color.Red; labelStatus.Text = "Vйлчилгээг засахад алдаа гарлаа: " + ex.Message; } }
private void timer_Elapsed(object sender, System.Timers.ElapsedEventArgs e) { if (running) return; running = true; SqlConnection con = new SqlConnection(strCon); try { con.Open(); sqlTicket.Connection = con; sqlTicket.Parameters["@fromdate"].Value = DateTime.Now.AddDays(-1); sqlTicket.CommandTimeout = 10; SqlDataReader reader = sqlTicket.ExecuteReader(); while (reader.Read()) { PSP.Ticket t = new PSP.Ticket(); t.tno = Convert.ToInt32(reader["c_ticketno"]); if (!currentTickets.Contains(t.tno)) { // while ticket result is not set //n++; t.isdn = reader["c_isdn"].ToString(); t.imsi = reader["c_imsi"].ToString(); t.procmd = reader["c_procmd"].ToString().ToUpper(); t.date = Convert.ToDateTime(reader["c_date"]); t.duration = Convert.ToInt32(reader["c_duration"]); t.param = reader["c_param"].ToString(); t.op = Convert.ToInt32(reader["c_operator"]); t.state = Convert.ToInt32(reader["c_state"]); t.tryCount = Convert.ToInt32(reader["c_trycount"]); t.result = reader["c_result"].ToString(); t.applyDate = Convert.ToDateTime(reader["c_applydate"]); t.billitem = Convert.ToInt32(reader["c_billitem"]); t.param = t.param.Trim('\r', '\n', ' '); ProcessTicket(ref t); } } reader.Close(); } catch (Exception ex) { AsyncLogWriter(ex.ToString()); } finally { running = false; con.Close(); } }
private void SaveProvisionData() { DataTable tableInput = Session["tableInput"] as DataTable; if (tableInput != null) { for (int i=0; i<tableInput.Rows.Count; i++) { try { PSP.Ticket t = new PSP.Ticket(); t.tno = 0; t.imsi = ""; t.op = -Convert.ToInt32(tableInput.Rows[i]["c_opid"]); t.date = Convert.ToDateTime(tableInput.Rows[i]["c_date"]); t.isdn = tableInput.Rows[i]["c_isdn"].ToString(); t.procmd = tableInput.Rows[i]["c_procmd"].ToString().ToUpper().Trim(); t.duration = Convert.ToInt32(tableInput.Rows[i]["c_duration"]); t.param = tableInput.Rows[i]["c_param"].ToString(); t.host = this.Request.UserHostName; string msg = this.PspProxy.SaveTicket(t, checkForceDup.Checked); try { tableInput.Rows[i].BeginEdit(); if (msg.Length == 0) tableInput.Rows[i]["c_error"] = "Ok"; else tableInput.Rows[i]["c_error"] = msg; tableInput.Rows[i].EndEdit(); } catch {} } catch (Exception ex) { tableInput.Rows[i].BeginEdit(); tableInput.Rows[i]["c_error"] = ex.Message; tableInput.Rows[i].EndEdit(); } } gridProvision.DataSource = tableInput; this.DataBind(); } }