mostrar error si se intenta añadir una linea a un pedido confirmado

This commit is contained in:
quique 2019-02-15 08:29:26 +01:00
parent 203e5853fa
commit 2aa0f132cf
4 changed files with 22 additions and 6 deletions

View File

@ -174,8 +174,15 @@ class DialogPrecios: MyViewVentas, UITableViewDelegate, UITableViewDataSource {
cmd.callbacks = CommandCallbacks(
handlerStart: {},
handlerFinish: {
self.aplication.pedido = cmd.order
_ = self.navigationController?.popViewController(animated: true)
if (cmd.order?.id as! Int) <= 0{
self.showErrorOrder()
}else{
self.aplication.pedido = cmd.order
_ = self.navigationController?.popViewController(animated: true)
}
},
handlerRetry: {
for d in self.datosSalvados
@ -196,6 +203,15 @@ class DialogPrecios: MyViewVentas, UITableViewDelegate, UITableViewDataSource {
execute(cmd);
}
func showErrorOrder(){
let alert = UIAlertController(title: "Error", message: "Error to create order.", preferredStyle: UIAlertControllerStyle.alert)
alert.addAction(UIAlertAction(title: "Ok", style: UIAlertActionStyle.default, handler: { action in
ControllerPedido.reiniciarPedido()
UIApplication.shared.keyWindow?.rootViewController = self.storyboard!.instantiateViewController(withIdentifier: "TabView")
}))
self.present(alert, animated: true, completion: nil)
}
func prepareOrder(_ show: Bool)
{
showProgress(show)

View File

@ -26,11 +26,11 @@
<key>CFBundlePackageType</key>
<string>APPL</string>
<key>CFBundleShortVersionString</key>
<string>1.3</string>
<string>1.31</string>
<key>CFBundleSignature</key>
<string>????</string>
<key>CFBundleVersion</key>
<string>20</string>
<string>21</string>
<key>LSApplicationCategoryType</key>
<string></string>
<key>LSRequiresIPhoneOS</key>

View File

@ -2578,9 +2578,9 @@
</resources>
<inferredMetricsTieBreakers>
<segue reference="XU7-TS-pTy"/>
<segue reference="18S-Hs-oUA"/>
<segue reference="3gV-oh-Xuw"/>
<segue reference="SDf-Ps-jKc"/>
<segue reference="vSc-oZ-yZF"/>
<segue reference="d1k-z9-Efa"/>
<segue reference="kNE-BM-XEL"/>
<segue reference="YHl-42-RSG"/>
<segue reference="ZHL-wy-ACl"/>