protected void savebtn_Click(object sender, EventArgs e) { _db._Id = int.Parse(idtxt.Text); _db._Method = methodtxt.Text; _db._Cost = float.Parse(costtxt.Text); _db._PerItemCost = float.Parse(perItemCosttxt.Text); _db._MinDeliveryTime = int.Parse(minDeliveryTimetxt.Text); _db._MaxDeliveryTime = int.Parse(maxDeliveryTimetxt.Text); _db.Execute("UpdateDeliveryMethodCapability"); if (_db.Success != null) { ScriptManager.RegisterStartupScript(this, GetType(), "showalert", "alert('Saved');", true); } }
private bool SaveOrderDetail(int orderId) { bool IsDone = false; int rowAffected = 0; for (int i = 0; i < SelectedBookOutDT.Rows.Count; i++) { _sb.Execute("SelectMaxIdOrderOut_ItemCapability"); if (_sb.Success != null) { _sb._Id = (int)_sb.Success; _sb._BookId = int.Parse(SelectedBookOutDT.Rows[i]["Id"].ToString()); _sb._Price = float.Parse(SelectedBookOutDT.Rows[i]["BookPrice"].ToString()); _sb._Quantity = int.Parse(SelectedBookOutDT.Rows[i]["Quantity"].ToString()); _sb._Total = _sb._Price * _sb._Quantity; _sb._OrderOutId = orderId; _sb.Execute("InsertOrderOut_ItemCapability"); if (_sb.Success != null) { bool v = bool.Parse(_sb.Success.ToString()); if (v == true) { _cb._Id = int.Parse(SelectedBookOutDT.Rows[i]["Id"].ToString()); _cb._Amount = int.Parse(SelectedBookOutDT.Rows[i]["Amount"].ToString()) - int.Parse(_sb._Quantity.ToString()); _cb.Execute("UpdateAmountInBookCapability"); if (_cb.Success != null) { bool c = bool.Parse(_cb.Success.ToString()); if (c == true) { rowAffected++; } } } } } } if (rowAffected == SelectedBookOutDT.Rows.Count) { IsDone = true; } return(IsDone); }
private void DisplayCatgeory() { try { _cb.Execute("SelectAllCategoryCapability"); if (_cb.Success != null) { CategoryDT = (DataTable)_cb.Success; CategoryGV.DataSource = CategoryDT; CategoryGV.DataBind(); indexToplbl.Text = _cb._Top.ToString(); indexBottomlbl.Text = _cb._Top.ToString(); } } catch (Exception) { } }
protected void PaymentMethodDDl_SelectedIndexChanged(object sender, EventArgs e) { if (PaymentMethodDDl.SelectedValue.ToString() == "Cash") { cashRow.Visible = true; ccGridViewRow.Visible = false; ccDetail.Visible = false; } else { cashRow.Visible = false; ccGridViewRow.Visible = true; _pmb._CustomerId = _pmb._Id; _pmb._Top = 1; _pmb._Flag = "C"; _pmb._PageSize = 1000; _pmb.Execute("SelectCustomer_CreditCardByCustomerIdCapability"); if (_pmb.Success != null) { CreditCardDT = (DataTable)_pmb.Success; for (int i = 0; i < CreditCardDT.Rows.Count; i++) { string n = CreditCardDT.Rows[i]["CCNumber"].ToString().TrimEnd(); StringBuilder sb = new StringBuilder(n); for (int j = 0; j < sb.Length; j++) { if (j >= 0 && j <= 11) { sb[j] = 'X'; } } n = sb.ToString(); CreditCardDT.Rows[i]["CCNumber"] = n; } CreditCardGV.DataSource = CreditCardDT; CreditCardGV.DataBind(); } } }
protected void Searchbtn_Click(object sender, EventArgs e) { _schb._Phone = phonetxt.Text; _schb._Top = 1; _schb._PageSize = 1; _schb._Flag = "C"; _schb.Execute("SearchSupplier_PhoneByPhoneCapability"); if (_schb.Success != null) { if (_schb._SearchSupplier_PhoneByPhoneCount > 0) { DataTable supplierDT = (DataTable)_schb.Success; if (supplierDT.Rows.Count > 0) { fullNametxt.Text = supplierDT.Rows[0]["SupplierName"].ToString().TrimEnd(); _pmb._Id = int.Parse(supplierDT.Rows[0]["Id"].ToString()); _pmb._SupplierName = supplierDT.Rows[0]["SupplierName"].ToString().TrimEnd(); Session["ProfileMonitorBroker"] = _pmb; } } } }
private void GetBookLessAmount() { _cb._Amount = 20; _cb.Execute("SelectBookByAmountCapability"); if (_cb.Success != null) { SelectedBookInDT = (DataTable)_cb.Success; if (!SelectedBookInDT.Columns.Contains("Quantity")) { SelectedBookInDT.Columns.Add("Quantity", typeof(int)); SelectedBookInDT.Columns.Add("Total", typeof(float)); for (int i = 0; i < SelectedBookInDT.Rows.Count; i++) { SelectedBookInDT.Rows[i]["Quantity"] = 10; SelectedBookInDT.Rows[i]["Total"] = float.Parse(SelectedBookInDT.Rows[i]["BookPrice"].ToString()) * 10; } } SelectedBookInGV.DataSource = SelectedBookInDT; SelectedBookInGV.DataBind(); } }