public static OfficerCheckResponse GetUserOfficerCheck(OfficerCheckRequest request) { Service client = new Service(); OfficerCheckResponse response = client.GetUserOfficerCheck(request); return(response); }
protected void CloseSubscribtionButton_Click(object sender, EventArgs e) { List <int> SelectedSubscriberIdList = new List <int>(); foreach (GridViewRow item in GridViewSubscriber.Rows) { CheckBox chk = (CheckBox)item.FindControl("CheckBoxSelect"); if (chk != null) { if (chk.Checked) { int SubscriberId = Convert.ToInt32(item.Cells[1].Text); SelectedSubscriberIdList.Add(SubscriberId); } } } if (SelectedSubscriberIdList.Count == 0) { LabelWarning.Text = "Abone Seçiniz!"; return; } else if (SelectedSubscriberIdList.Count > 1) { LabelWarning.Text = "1 Aboneden Fazla Seçim Yapılamaz!"; return; } else { OfficerCheckResponse UserInfo = (OfficerCheckResponse)Session["UserInfo"]; int TotalAmount = 0; foreach (int SubscriberId in SelectedSubscriberIdList) { TotalAmount = WebServiceHelpers.GetInvoiceAllUnpaidTotalAmount(SubscriberId); if (TotalAmount > 0) { string msg = TotalAmount.ToString() + " TL tutarında abone borcu bulunmaktadır. Aboneden tutarı tahsil etmeniz gerekmektedir. Tahsilata devam etmek istiyor musunuz?"; LabelMsg.Text = "<script language='javascript'>" + Environment.NewLine + "if(window.confirm('" + msg + "')) document.location = 'SubscriberPayBill.aspx';</script>"; } else { string msg = "Borç Bulunmamaktadır. Depozito İade Edebilirsiniz. Abonelik Kapatılıyor."; LabelMsg.Text = "<script language='javascript'>" + Environment.NewLine + "if(window.confirm('" + msg + "')) document.location = 'CloseSubscription.aspx';</script>"; bool Result = WebServiceHelpers.CloseSubscription(new CloseSubscriptionRequest() { SubscriberId = SubscriberId, UpdateUser = UserInfo.UserCode }); LabelWarning.Text = "Abonelik Kapatıldı"; } } FillGrid(); } }
public static OfficerCheckResponse GetUserOfficerCheck(OfficerCheckRequest request) { OfficerCheckResponse response = new OfficerCheckResponse(); using (SqlConnection con = new SqlConnection(Variables.PaymentSystemDBConnection)) { try { con.Open(); using (SqlCommand cmd = new SqlCommand(SQLConstants.SP_GET_USER_OFFICER_CHECK, con)) { cmd.CommandType = CommandType.StoredProcedure; cmd.Parameters.Clear(); cmd.Parameters.AddWithValue("@USER_CODE", request.UserCode); cmd.Parameters.AddWithValue("@USER_PASSWORD", request.UserPassword); SqlDataAdapter adapter = new SqlDataAdapter(); adapter.SelectCommand = cmd; DataTable table = new DataTable(); adapter.Fill(table); if (table.Rows.Count > 0) { response.OfficerId = Convert.ToInt32(table.Rows[0]["OFFICER_ID"]); response.UserCode = table.Rows[0]["USER_CODE"].ToString(); response.Name = table.Rows[0]["NAME"].ToString(); response.Surname = table.Rows[0]["SURNAME"].ToString(); response.InsertUser = table.Rows[0]["INSERT_USER"].ToString(); response.InsertDate = Convert.ToDateTime(table.Rows[0]["INSERT_DATE"].ToString()); response.UpdateUser = table.Rows[0]["UPDATE_USER"].ToString(); if (!String.IsNullOrEmpty(table.Rows[0]["UPDATE_DATE"].ToString())) { response.UpdateDate = Convert.ToDateTime(table.Rows[0]["UPDATE_DATE"].ToString()); } } } } catch (Exception ex) { throw; } } return(response); }
protected void PayButton_Click(object sender, EventArgs e) { List <int> SelectedInvoiceIdList = new List <int>(); foreach (GridViewRow item in GridViewInvoice.Rows) { CheckBox chk = (CheckBox)item.FindControl("CheckBoxSelect"); if (chk != null) { if (chk.Checked) { int InvoiceId = Convert.ToInt32(item.Cells[1].Text); SelectedInvoiceIdList.Add(InvoiceId); } } } if (SelectedInvoiceIdList.Count == 0) { LabelWarning.Text = "Fatura Seçiniz!"; return; } else { OfficerCheckResponse UserInfo = (OfficerCheckResponse)Session["UserInfo"]; foreach (int InvoiceId in SelectedInvoiceIdList) { bool Result = WebServiceHelpers.UpdateInvoicePay(new UpdateInvoicePayRequest() { InvoiceId = InvoiceId, UpdateUser = UserInfo.UserCode }); } FillGrid(); LabelWarning.Text = "Fatura Ödendi"; } }
protected void SaveButton_Click(object sender, EventArgs e) { OfficerCheckResponse UserInfo = (OfficerCheckResponse)Session["UserInfo"]; bool Result = WebServiceHelpers.InsertSubscriber(new InsertSubscriberRequest() { SubscriberTypeId = Convert.ToInt32(RadioButtonListCustomer.SelectedItem.Value), IdentificationTaxNumber = IdentificationTaxNumberTextBox.Text.Trim(), UserPassword = PasswordTextBox.Text, Name = NameTextBox.Text.Trim(), Surname = SurnameTextBox.Text.Trim(), SubscriptionId = Convert.ToInt32(DropDownListSubscriptionType.SelectedValue), InsertUser = UserInfo.UserCode }); if (Result) { LabelWarning.Text = "Abone Kayıt Edildi"; } else { LabelWarning.Text = "Abone Kayıt Edilemedi!"; } }