protected void btnSave_Click(object sender, EventArgs e) { var obj = new VEHICLE(); obj.VEHICLE_REGNO = popTxtReg.Text; obj.VEHICLE_CODE = popTxtCode.Text; obj.VEHICLE_TYPENO = popTxtTypNO.Text; var cmd = new VehicleService(obj); if (flag.Text.Equals("Add")) { obj.Action = ActionEnum.Create; obj.CREATE_DATE = DateTime.Now; obj.CREATE_EMPLOYEE_ID = 0; obj.UPDATE_DATE = DateTime.Now; obj.UPDATE_EMPLOYEE_ID = 0; obj.SYE_DEL = true; cmd.Add(); } else { obj.Action = ActionEnum.Update; obj.VEHICLE_ID = Convert.ToInt32(ViewState["VehicleID"].ToString()); obj.UPDATE_DATE = DateTime.Now; obj.UPDATE_EMPLOYEE_ID = 0; obj.SYE_DEL = true; cmd.Edit(); } ViewState["VehicleID"] = null; Response.Redirect("SearchVehicle.aspx"); }
private void InitialData() { var cmd = new VehicleService(); DataSouce = cmd.GetALL(); gridVehicle.DataSource = DataSouce; gridVehicle.DataBind(); }
private void InitialDataPopup() { if (ViewState["VehicleID"] != null) { var cmd = new VehicleService(); _item = cmd.Select(Convert.ToInt32(ViewState["VehicleID"].ToString())); if (_item != null) { popTxtCode.Text = _item.VEHICLE_CODE; popTxtReg.Text = _item.VEHICLE_REGNO; popTxtTypNO.Text = _item.VEHICLE_TYPENO; flag.Text = "Edit"; } } }
private void InitialDataPopup() { int orderId = Convert.ToInt32(ViewState["orderId"]); var cmd = new OrderDetailService(); var cmdDetail = new DeliveryOrderDetailService(); var cmdDO = new DeliveryOrderService(); DataSouceDetail = cmd.GetALLInclude().Where(x => x.ORDER_ID == orderId && x.PRODUCT_QTY != x.PRODUCT_SEND_QTY).ToList(); foreach (ORDER_DETAIL item in DataSouceDetail) { item.PRODUCT_QTY -= item.PRODUCT_SEND_QTY; } gridProductDetail.DataSource = DataSouceDetail; gridProductDetail.DataBind(); var cmdVehicle = new VehicleService(); var list = cmdVehicle.GetALL(); foreach (var item in list) { ddlVehicle.Items.Add(new ListItem(item.VEHICLE_REGNO, item.VEHICLE_ID.ToString())); } }