public void Filter_Get(int iDisplayLength, int iDisplayStart, int iSortCol_0, string sSortDir_0, string sSearch)
        {
            int filteredCount = 0;

            List<OrderSheet> OrderSheet_List = new List<OrderSheet>();

            DataTable dt = OrderSheet_DA.Filter_Get_OrderSheet(iDisplayLength, iDisplayStart, iSortCol_0, sSortDir_0, sSearch);

            foreach (DataRow row in dt.Rows)
            {
                filteredCount = int.Parse(row["TotalCount"].ToString());

                OrderSheet _OrderSheet = new OrderSheet();

                _OrderSheet.Id = int.Parse(row["Id"].ToString());
                _OrderSheet.ProformaInvoiceName = row["Pi_No"].ToString();
                _OrderSheet.ORDERNO = row["ORDERNO"].ToString();
                if (row["ORDERDATE"].ToString() != "")
                    _OrderSheet.ORDERDATEstring = Convert.ToDateTime(row["ORDERDATE"].ToString()).ToString("MM/dd/yyyy");
                _OrderSheet.PRODDIV = row["PRODDIV"].ToString();
                _OrderSheet.AMENDMENTNO = row["AMENDMENTNO"].ToString();
                if (row["AMENDMENTDATE"].ToString() != "")
                    _OrderSheet.AMENDMENTDATEstring = Convert.ToDateTime(row["AMENDMENTDATE"].ToString()).ToString("MM/dd/yyyy");
                if (row["SHIPMENTDATE"].ToString() != "")
                    _OrderSheet.SHIPMENTDATEstring = Convert.ToDateTime(row["SHIPMENTDATE"].ToString()).ToString("MM/dd/yyyy");

                _OrderSheet.DESTINATION = row["DESTINATION"].ToString();
                _OrderSheet.TRANSPORTBY = row["TRANSPORTBY"].ToString();
                _OrderSheet.PRICETERM = row["PRICETERM"].ToString();

                OrderSheet_List.Add(_OrderSheet);

            }
            var result = new
            {
                iTotalRecords = GetTotalCount(),
                iTotalDisplayRecords = filteredCount,
                aaData = OrderSheet_List
            };

            JavaScriptSerializer js = new JavaScriptSerializer();
            Context.Response.Write(js.Serialize(result));
        }
        public OrderSheet Get(int ID)
        {
            OrderSheet _OrderSheet = new OrderSheet();

            DataTable dt = OrderSheet_DA.Get(ID);

            foreach (DataRow row in dt.Rows)
            {

                _OrderSheet.Id = int.Parse(row["Id"].ToString());
                _OrderSheet.ProformaInvoiceId = int.Parse(row["ProformaInvoiceId"].ToString());

                _OrderSheet.TOTALCTN = row["TOTALCTN"].ToString();
                _OrderSheet.ORDERNO = row["ORDERNO"].ToString();
                if (row["ORDERDATE"].ToString() != "")
                    _OrderSheet.ORDERDATEstring = Convert.ToDateTime(row["ORDERDATE"].ToString()).ToString("MM/dd/yyyy");

                _OrderSheet.PRODDIV = row["PRODDIV"].ToString();
                _OrderSheet.AMENDMENTNO = row["AMENDMENTNO"].ToString();
                if (row["AMENDMENTDATE"].ToString() != "")
                    _OrderSheet.AMENDMENTDATEstring = Convert.ToDateTime(row["AMENDMENTDATE"].ToString()).ToString("MM/dd/yyyy");
                if (row["SHIPMENTDATE"].ToString() != "")
                    _OrderSheet.SHIPMENTDATEstring = Convert.ToDateTime(row["SHIPMENTDATE"].ToString()).ToString("MM/dd/yyyy");

                _OrderSheet.DESTINATION = row["DESTINATION"].ToString();
                _OrderSheet.TRANSPORTBY = row["TRANSPORTBY"].ToString();
                _OrderSheet.PRICETERM = row["PRICETERM"].ToString();
                _OrderSheet.NOTE = row["NOTE"].ToString();
            }
            return _OrderSheet;
        }
        public string Submit(OrderSheet orderSheet, List<OrderSheet_B> listOrderSheet_B, List<Sale_B_KNITTED> listOrderSheet_B_KNITTED,
                             List<List<Sale_B_WOVEN>> listOrderSheet_B_WOVEN,
            List<Sale_B_NONWOVEN> listOrderSheet_B_NONWOVEN, List<Sale_B_TERRY> listOrderSheet_B_TERRY, List<Sale_B_KNITWRIST> listOrderSheet_B_KNITWRIST
            , List<Sale_B_LEATHER> listOrderSheet_B_LEATHER)
        {
            string msg = "";

            if (orderSheet.Id == 0)
            {
                orderSheet.CreatedBy = Session["User"].ToString();
                msg = OrderSheet_DA.Insert(orderSheet, listOrderSheet_B, listOrderSheet_B_KNITTED, listOrderSheet_B_WOVEN, listOrderSheet_B_NONWOVEN, listOrderSheet_B_TERRY, listOrderSheet_B_KNITWRIST, listOrderSheet_B_LEATHER);

            }
            else
            {
                orderSheet.UpdatedBy = Session["User"].ToString();
                msg = OrderSheet_DA.Update(orderSheet, listOrderSheet_B, listOrderSheet_B_KNITTED, listOrderSheet_B_WOVEN, listOrderSheet_B_NONWOVEN, listOrderSheet_B_TERRY, listOrderSheet_B_KNITWRIST, listOrderSheet_B_LEATHER);
            }

            return msg;
        }