Esempio n. 1
0
        //protected void grdorder_PageIndexChanging(object sender, GridViewPageEventArgs e)
        //{
        //    grdorder.PageIndex = e.NewPageIndex;
        //    LoadGrid(lblLCNo.Text.ToString());
        //}

        protected void imgbtnOrderSheetEdit_Click(object sender, ImageClickEventArgs e)
        {
            List <LC_OrderEntry> orders = new List <LC_OrderEntry>();
            ImageButton          imgbtn = (ImageButton)sender;
            GridViewRow          row    = (GridViewRow)imgbtn.NamingContainer;

            try
            {
                string orderId         = "";
                Label  lblOrderEntryID = (Label)grdorder.Rows[row.RowIndex].FindControl("lblOrderEntryID");
                if (lblOrderEntryID != null)
                {
                    string OCODE = ((SessionUser)Session["SessionUser"]).OCode;
                    orderId = lblOrderEntryID.Text;

                    orders = masterBLL.GetOrderByOrderIdandOcode(orderId, OCODE);

                    if (orders.Count > 0)
                    {
                        foreach (LC_OrderEntry order in orders)
                        {
                            hidorderid.Value = order.OrderEntryID.ToString();
                            //ddlSeason.SelectedValue = order.Season.ToString();
                            txtOrder.Text              = order.OrderNo;
                            txtArticle.Text            = order.Article;
                            txtColor.Text              = order.ColorSpecification;
                            ddlStyle.SelectedItem.Text = order.Style;
                            txtOrderQty.Text           = order.OrderQuantity;
                            txtFob.Text   = Convert.ToString(order.FobQty);
                            txtDate.Text  = Convert.ToString(order.ShipmentDate);
                            txtValue.Text = Convert.ToString(order.TotalQty);
                            LoadSeason();
                            ddlSeason.SelectedValue   = order.SeasonId.ToString();
                            txtsize.Text              = order.Size;
                            txtSupplierNo.Text        = order.Supplier_No;
                            txtOrderReceivedDate.Text = Convert.ToString(order.OrderReceiveDate);
                            txtBuyerDepartment.Text   = order.Buyer_Department;
                            //hidRegionName.Value = txtbxRegionName.Text = region.RegionName;
                            //txtbxResgionCode.Text = region.RegionCode;
                            if (btnSubmit.Text == "Add")
                            {
                                btnSubmit.Text = "Update";
                            }
                        }
                    }
                }
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }
        protected void imgbtnOrderSheetEdit_Click(object sender, ImageClickEventArgs e)
        {
            List <LC_OrderEntry> orders = new List <LC_OrderEntry>();
            ImageButton          imgbtn = (ImageButton)sender;
            GridViewRow          row    = (GridViewRow)imgbtn.NamingContainer;

            try
            {
                string orderId         = "";
                Label  lblOrderEntryID = (Label)grdorder.Rows[row.RowIndex].FindControl("lblOrderEntryID");
                if (lblOrderEntryID != null)
                {
                    string OCODE = ((SessionUser)Session["SessionUser"]).OCode;
                    orderId = lblOrderEntryID.Text;

                    orders = masterBLL.GetOrderByOrderIdandOcode(orderId, OCODE);

                    if (orders.Count > 0)
                    {
                        foreach (LC_OrderEntry order in orders)
                        {
                            // hidorderid.Value = order.OrderEntryID.ToString();
                            txtPOrder.Text = order.OrderNo;

                            txtCustomerStyle.Text = order.Style_Description;
                            // txtYarnFabrication.Text = order.Yarn_Fabrication;

                            // txttimeOfDelivery.Text = order.TimeOf_Delevery;
                            // txtFromPort.Text = order.PlaceOf_DisPatchFrom;
                            // txtToPort.Text = order.PlaceOf_DisPatchTo;
                            //  txtTotalAmount.Text = Convert.ToString(order.Total_Amount);
                            //   txtStyleColor.Text = order.ColorSpecification;
                            LoadBuyingDepartmentList();
                            ddlBuyerDepartment.SelectedValue = order.Buyer_DepartmentId.ToString();;
                            GetOffice();
                            ddlTTOffice.SelectedValue = Convert.ToString(order.Office_ID);
                            // GetMerchandiserDept();
                            //ddlMerchandiserDept.SelectedValue = Convert.ToString(order.Merch_Dept_Id);
                            //GetMerchandiserName();
                            ddlMerchandiserName.SelectedValue = order.EID;
                            // LoadPrincipalList();
                            // ddlPrincipal.SelectedValue = order.Principal_Id.ToString();
                            LoadBuyerList();
                            ddlBuyer.SelectedValue  = order.Buyer_Name;
                            ddlSeason.SelectedValue = Convert.ToString(order.SeasonId);

                            //  ddlFactory.SelectedValue = Convert.ToString(order.FactoryId);
                            // ddlGender.SelectedValue = Convert.ToString(order.Gender_Id);

                            ddlUnit.SelectedValue         = Convert.ToString(order.Unit_Id);
                            ddlStyle.SelectedValue        = Convert.ToString(order.StyleId);
                            ddlCategory.SelectedValue     = Convert.ToString(order.Style_Category_Id);
                            ddlCurrency.SelectedItem.Text = order.Currency;
                            //txtFob.Text = Convert.ToString(order.UnitPrice);
                            txtOrderQty.Text     = Convert.ToString(order.OrderQuantity);
                            txtFOBPort.Text      = order.FOB_Port;
                            txtShipmentDate.Text = ConvertDate(order.ShipmentDate.ToString());
                            // txtCommissionPer.Text = order.CommissionPersent.ToString();
                            // txtTotalCommission.Text = order.TotalCommission.ToString();
                            // txtOriginalContractDate.Text = ConvertDate(order.OrderReceiveDate.ToString());
                            txtOrderConfirmationDate.Text     = ConvertDate(order.LC_Reveived_Date.ToString());
                            ddlShipmentMode.SelectedItem.Text = order.Shipment_Mode;
                            if (btnSubmit.Text == "Add")
                            {
                                btnSubmit.Text = "Update";
                            }
                        }
                    }
                }
                ShowDiv.Visible  = true;
                ShowGrid.Visible = true;
                //AddOrder.Visible = false;
                chkStleWise.Checked = true;
                OrderNo2.Visible    = true;
                OrderNo1.Visible    = false;
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }