Exemple #1
0
        protected void GVClientsInvoice_RowDeleting(object sender, GridViewDeleteEventArgs e)
        {
            ClientsInvoiceDAL invoice = new ClientsInvoiceDAL
            {
                ConnectionString = ConfigurationManager.ConnectionStrings["MySQLTest"].ToString()
            };

            string IDString = GVClientsInvoice.DataKeys[e.RowIndex].Values["OrderNo"].ToString();

            invoice.DeleteClientsInvoice(IDString);

            FetchClientsInvoice(search, search, company, sdate, edate);
        }
Exemple #2
0
        protected void FetchClientsInvoice(string OrderNo, string EmpID, int company, DateTime sdate, DateTime edate)
        {
            ClientsInvoiceDAL invoice = new ClientsInvoiceDAL
            {
                ConnectionString = ConfigurationManager.ConnectionStrings["MySQLTest"].ToString()
            };

            sdate   = (string.IsNullOrEmpty(startDate.Text)) ? DateTime.MinValue : Convert.ToDateTime(startDate.Text);
            company = Convert.ToInt32(CompaniesList.SelectedValue);
            List <ClientsInvoice> ClientsInvoiceList = invoice.GetClientsInvoice(OrderNo, EmpID, sdate, edate, company);

            GVClientsInvoice.DataSource = ClientsInvoiceList;
            GVClientsInvoice.DataBind();
        }
Exemple #3
0
        protected void GVClientsInvoice_RowUpdating(object sender, GridViewUpdateEventArgs e)
        {
            ClientsInvoiceDAL invoice = new ClientsInvoiceDAL
            {
                ConnectionString = ConfigurationManager.ConnectionStrings["MySQLTest"].ToString()
            };
            ClientsInvoice command = new ClientsInvoice();

            //{
            //    OrderNo = (GVClientsInvoice.Rows[e.RowIndex].FindControl("LblInvoicesOrderNoEdit") as Label).Text,
            //    EmployeeID = (GVClientsInvoice.Rows[e.RowIndex].FindControl("TxtInvoicesEmpID") as TextBox).Text,
            //    FirstName = (GVClientsInvoice.Rows[e.RowIndex].FindControl("TxtInvoicesFName") as TextBox).Text,
            //    LastName = (GVClientsInvoice.Rows[e.RowIndex].FindControl("TxtInvoicesLName") as TextBox).Text,
            //    CatalogName = (GVClientsInvoice.Rows[e.RowIndex].FindControl("TxtInvoicesCName") as TextBox).Text,
            //    Quantity = Convert.ToInt32((GVClientsInvoice.Rows[e.RowIndex].FindControl("TxtInvoicesQuantity") as TextBox).Text),
            //    OrderDate = Convert.ToDateTime((GVClientsInvoice.Rows[e.RowIndex].FindControl("TxtInvoicesOrderDate") as TextBox).Text),
            //    LocalCost = Convert.ToDouble((GVClientsInvoice.Rows[e.RowIndex].FindControl("TxtInvoicesLocalCost") as TextBox).Text),

            //    //USDCost = Convert.ToDouble((GVClientsInvoice.Rows[e.RowIndex].FindControl("TxtInvoicesUSDCost") as TextBox).Text),
            //    TotalLocalCost = Convert.ToDouble(GVClientsInvoice.DataKeys[e.RowIndex].Values["TotalLocalCost"].ToString()),
            //    RedemptionPoints = (GVClientsInvoice.Rows[e.RowIndex].FindControl("TxtInvoicesRP") as TextBox).Text,
            //    ReasonofReturn = (GVClientsInvoice.Rows[e.RowIndex].FindControl("DDLInvoicesReason") as DropDownList).SelectedValue,

            //    Country = GVClientsInvoice.DataKeys[e.RowIndex].Values[2].ToString()
            //};
            command.OrderNo     = (GVClientsInvoice.Rows[e.RowIndex].FindControl("LblInvoicesOrderNoEdit") as Label).Text;
            command.EmployeeID  = (GVClientsInvoice.Rows[e.RowIndex].FindControl("TxtInvoicesEmpID") as TextBox).Text;
            command.FirstName   = (GVClientsInvoice.Rows[e.RowIndex].FindControl("TxtInvoicesFName") as TextBox).Text;
            command.LastName    = (GVClientsInvoice.Rows[e.RowIndex].FindControl("TxtInvoicesLName") as TextBox).Text;
            command.CatalogName = (GVClientsInvoice.Rows[e.RowIndex].FindControl("TxtInvoicesCName") as TextBox).Text;
            command.Quantity    = Convert.ToInt32((GVClientsInvoice.Rows[e.RowIndex].FindControl("TxtInvoicesQuantity") as TextBox).Text);
            command.OrderDate   = Convert.ToDateTime((GVClientsInvoice.Rows[e.RowIndex].FindControl("TxtInvoicesOrderDate") as TextBox).Text);
            command.LocalCost   = Convert.ToDouble((GVClientsInvoice.Rows[e.RowIndex].FindControl("TxtInvoicesLocalCost") as TextBox).Text);

            //USDCost = Convert.ToDouble((GVClientsInvoice.Rows[e.RowIndex].FindControl("TxtInvoicesUSDCost") as TextBox).Text);
            command.TotalLocalCost   = Convert.ToDouble(GVClientsInvoice.DataKeys[e.RowIndex].Values["TotalLocalCost"].ToString());
            command.RedemptionPoints = (GVClientsInvoice.Rows[e.RowIndex].FindControl("TxtInvoicesRP") as TextBox).Text;
            command.ReasonofReturn   = (GVClientsInvoice.Rows[e.RowIndex].FindControl("DDLInvoicesReason") as DropDownList).SelectedValue;

            command.Country = GVClientsInvoice.DataKeys[e.RowIndex].Values[2].ToString();

            invoice.InsertClientsInvoice(command);
            GVClientsInvoice.EditIndex = -1;
            FetchClientsInvoice(search, search, company, sdate, edate);
        }