protected void imgBtnUpload_Click(object sender, ImageClickEventArgs e) { try { ImageButton imgBtnUpload = (ImageButton)sender; GridViewRow row = (GridViewRow)imgBtnUpload.NamingContainer; Int32 ID = Convert.ToInt32(gvSalesOrders.DataKeys[row.RowIndex].Values["ID"].ToString()); SOKanban.RetryImport(ID); DisplaySalesOrdersInGridView(); } catch (Exception ex) { ltlMessage.Text = ex.Message.ToString().ToErrorMessageFormat(); } }
private void DisplaySalesOrdersInGridView() { SOKanban _SOKanban = new SOKanban(); string FromOrderDate = txtOrderDate.Text.Trim(); string ToOrderDate = txtOrderDate2.Text.Trim(); if (FromOrderDate != string.Empty || ToOrderDate != string.Empty) { if (FromOrderDate == string.Empty && ToOrderDate != string.Empty) { FromOrderDate = ToOrderDate; } if (ToOrderDate == string.Empty && FromOrderDate != string.Empty) { ToOrderDate = FromOrderDate; } _SOKanban.OrderDate = DateTime.ParseExact(FromOrderDate, "MM/dd/yyyy", CultureInfo.InvariantCulture); _SOKanban.OrderDate2 = DateTime.ParseExact(ToOrderDate, "MM/dd/yyyy", CultureInfo.InvariantCulture); } string FromDeliveryDate = txtDeliveryDate.Text.Trim(); string ToDeliveryDate = txtDeliveryDate2.Text.Trim(); if (FromDeliveryDate != string.Empty || ToDeliveryDate != string.Empty) { if (FromDeliveryDate == string.Empty && ToDeliveryDate != string.Empty) { FromDeliveryDate = ToDeliveryDate; } if (ToDeliveryDate == string.Empty && FromDeliveryDate != string.Empty) { ToDeliveryDate = FromDeliveryDate; } _SOKanban.DeliveryDate = DateTime.ParseExact(FromDeliveryDate, "MM/dd/yyyy", CultureInfo.InvariantCulture); _SOKanban.DeliveryDate2 = DateTime.ParseExact(ToDeliveryDate, "MM/dd/yyyy", CultureInfo.InvariantCulture); } _SOKanban.RefID = txtRefID.Text == string.Empty ? (Nullable <Int32>)null : Convert.ToInt32(txtRefID.Text); _SOKanban.OrderedBy = txtOrderBy.Text; _SOKanban.DeliverTo = txtDeliveryTo.Text; _SOKanban.YourRef = txtYourRef.Text; _SOKanban.OrderNo = txtOrderNumber.Text; _SOKanban.Description = txtOrderDescription.Text; _SOKanban.DeliveryOrderNo = txtDeliveryOrderNo.Text; _SOKanban.ManifestNo = txtManifestNo.Text; _SOKanban.RIT = txtRIT.Text; _SOKanban.ItemCode = txtItemCode.Text; _SOKanban.CustomerPartNo = txtCustomerPartNo.Text; _SOKanban.ItemDescription = txtItemDescription.Text; _SOKanban.DealingType = txtDealingType.Text; Nullable <Int32> status = Convert.ToInt32(ddlStatus.SelectedItem.Value); if (status < 0) { status = null; } _SOKanban.Status = status; SearchOption searchOption = rblFilter.SelectedValue.ToSearchOptionEnum(); gvSalesOrders.DataSource = _SOKanban.Retrieve(searchOption); gvSalesOrders.DataBind(); }