public void bindData()
 {
     DeliveryOrderStatus status = new DeliveryOrderStatus();
     status.LoadAll();
     GridViewStatus.DataSource = status.DefaultView;
     GridViewStatus.DataBind();
 }
Ejemplo n.º 2
0
        protected void Page_Load(object sender, EventArgs e)
        {
            BLL.TransformationSupplier DOO = new BLL.TransformationSupplier();
            DOO.LoadAll();
            drpTransformationSupplier.DataSource = DOO.DefaultView;
            drpTransformationSupplier.DataValueField = TransformationSupplier.ColumnNames.TransformationSupplierID;
            drpTransformationSupplier.DataTextField = TransformationSupplier.ColumnNames.TransformationSupplierName;
            drpTransformationSupplier.DataBind();

            DeliveryOrderStatus Ds = new DeliveryOrderStatus();
            Ds.LoadAll();
            drpDeliveryOrderStatus.DataSource = Ds.DefaultView;
            drpDeliveryOrderStatus.DataValueField = DeliveryOrderStatus.ColumnNames.DeliveryOrderStatusID;
            drpDeliveryOrderStatus.DataTextField = DeliveryOrderStatus.ColumnNames.DeliveryOrderStatusNameAr;
            drpDeliveryOrderStatus.DataBind();
        }
        protected void btnSave_Click(object sender, EventArgs e)
        {
            DeliveryOrderStatus status = new DeliveryOrderStatus();

            if (EditDeliveryOrderStatus > 0)
            {
                status.LoadByPrimaryKey(EditDeliveryOrderStatus);
            }
            else
            {
                status.AddNew();
            }
            status.DeliveryOrderStatusName = txtStatusName.Text;
            status.DeliveryOrderStatusNameAr = txtStatusNameAr.Text;
            status.StatusClass = dropDownStatusColor.Value;
            status.Save();

            ClearFields();
            bindData();
            panelStatusGrid.Visible = true;
            panelStatusEdit.Visible = false;
        }
Ejemplo n.º 4
0
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!IsPostBack)
            {
                Master.PageTitle = "اوامر تشغيل السيارات";

                DeliveryOrderBind();

                if (getQueryString_DeliveryOrder > 0)
                {
                    BLL.DeliveryOrder EditDO = new BLL.DeliveryOrder();
                    EditDO.LoadByPrimaryKey(getQueryString_DeliveryOrder);
                    txtCarNumber.Text = EditDO.CarNumber;
                    txtClientCode.Text = (EditDO.ClientCode).ToString();
                    txtkiloMeterAfter.Text = EditDO.KilometerCounterAfter.ToString();
                    txtKiloMeterBefore.Text = EditDO.KilometerCounterBefore.ToString();
                    txtTotalPrice.Text = EditDO.TotalPrice.ToString();
                    txtGeneralDeliveryCode.Text = EditDO.GeneralDeliveryCode;
                    drpTransformationSupplier.Text = EditDO.TransformationSupplier;
                    txtDriverName.Text = EditDO.DriverName;
                    txtDriverNationID.Text = EditDO.DriverNationID.ToString();
                    txtDriverTelephone.Text = EditDO.DriverTelephone;
                    txtCarType.Text = EditDO.CarType;
                    txtDepartmentResponsable.Text = EditDO.DepartmentResponsableName;
                    txtDeliveryOrderDate.Text = EditDO.DeliveryOrderDate.ToString("dd/MM/yyyy");
                    txtPermission.Text = EditDO.PermationNumber.ToString();
                    drpDepartment.Text = EditDO.Department;
                    txtDeliveryOrderName.Text = EditDO.DeliveryOrderName;
                    drpStatusGeneral.SelectedValue = EditDO.DeliveryOrderStatusID.ToString();
                    drpDepartment.SelectedValue = EditDO.DepartmentID.ToString();
                    DeliveryOrderDetailsBind();

                    WidGrdGeneralDeliveryOrder.Visible = false;
                    WidEditDeliveryOrder.Visible = true;
                    PanelDeliveryOrderDetails.Visible = true;
                    createNewDeliveryOrder.Visible = false;
                }

                if (getQueryString_DeliveryOrderDetails > 0)
                {
                    DeliveryOrderDetails DODEdit = new DeliveryOrderDetails();
                    DODEdit.LoadByPrimaryKey(getQueryString_DeliveryOrderDetails);
                    txtDeliveryFrom.Text = DODEdit.DeliveryFrom;
                    txtDeliveryTo.Text = DODEdit.DeliveryTo;
                    txtDateFrom.Text = DODEdit.DateFrom.ToString("HH:mm");
                    txtDateTo.Text = DODEdit.DateTo.ToString("HH:mm");
                    txtRecivableName.Text = DODEdit.ReceivableName;
                    txtRecivableTelephone.Text = DODEdit.ReceivableTelephone;
                    if (!DODEdit.IsColumnNull("Price"))
                        txtPrice.Text = DODEdit.Price.ToString();
                    else
                        txtPrice.Text = "0.0";
                    txtDeliveryOrderCode.Text = DODEdit.DeliveryOrderCode;
                    drpStatusDetails.Text = DODEdit.DeliveryOrderStatusID.ToString();

                    if (!DODEdit.IsColumnNull("WatingHours"))
                        txtWatingHours.Text = DODEdit.WatingHours.ToString();
                    else
                        txtWatingHours.Text = "0";

                }

                BLL.DeliveryOrderStatus DOS = new DeliveryOrderStatus();
                DOS.LoadAll();
                drpStatusDetails.DataSource = DOS.DefaultView;
                drpStatusDetails.DataValueField = DeliveryOrderStatus.ColumnNames.DeliveryOrderStatusID;
                drpStatusDetails.DataTextField = DeliveryOrderStatus.ColumnNames.DeliveryOrderStatusNameAr;

                drpStatusDetails.DataBind();

                drpStatusGeneral.DataSource = DOS.DefaultView;
                drpStatusGeneral.DataValueField = DeliveryOrderStatus.ColumnNames.DeliveryOrderStatusID;
                drpStatusGeneral.DataTextField = DeliveryOrderStatus.ColumnNames.DeliveryOrderStatusNameAr;
                drpStatusGeneral.DataBind();

                BLL.TransformationSupplier DOO = new BLL.TransformationSupplier();
                DOO.LoadAll();
                drpTransformationSupplier.DataSource = DOO.DefaultView;
                drpTransformationSupplier.DataValueField = TransformationSupplier.ColumnNames.TransformationSupplierID;
                drpTransformationSupplier.DataTextField = TransformationSupplier.ColumnNames.TransformationSupplierName;
                drpTransformationSupplier.DataBind();

                Department dep = new Department();
                dep.LoadAll();
                drpDepartment.DataSource = dep.DefaultView;
                drpDepartment.DataValueField = Department.ColumnNames.DepartmentID;
                drpDepartment.DataTextField = Department.ColumnNames.DepartmentName;
                drpDepartment.DataBind();

            }
        }
 protected void GridViewStatus_RowCommand(object sender, GridViewCommandEventArgs e)
 {
     if (e.CommandName == "editStatus")
     {
         DeliveryOrderStatus status = new DeliveryOrderStatus();
         status.LoadByPrimaryKey(int.Parse(e.CommandArgument.ToString()));
         txtStatusName.Text = status.DeliveryOrderStatusName;
         txtStatusNameAr.Text = status.DeliveryOrderStatusNameAr;
         dropDownStatusColor.Value = status.StatusClass;
         EditDeliveryOrderStatus = int.Parse(e.CommandArgument.ToString());
         panelStatusGrid.Visible = false;
         panelStatusEdit.Visible = true;
     }
     else if (e.CommandName == "deleteStatus")
     {
         DeliveryOrderStatus status = new DeliveryOrderStatus();
         status.LoadByPrimaryKey(int.Parse(e.CommandArgument.ToString()));
         status.MarkAsDeleted();
         status.Save();
         bindData();
     }
 }