/// <summary> /// 上传 /// </summary> /// <param name="sender"></param> /// <param name="e"></param> protected void btnData_Click(object sender, EventArgs e) { try { if (Grid1.SelectedRowIndexArray.Length == 0) { Alert.Show("请至少选择一项!", MessageBoxIcon.Information); } else if (Grid1.SelectedRowIndexArray.Length > 1) { Alert.Show("只能选择一项!", MessageBoxIcon.Information); } else { //验证是否已作废 string flag = Grid1.DataKeys[Grid1.SelectedRowIndexArray[0]][1].ToString(); if (flag.Equals("0")) { Alert.Show("单据已作废,不允许上传", MessageBoxIcon.Information); return; } //验证是否已提交 string t6Status = Grid1.DataKeys[Grid1.SelectedRowIndexArray[0]][2].ToString(); if (t6Status.Equals("已同步")) { Alert.Show("单据已同步,不允许再次上传", MessageBoxIcon.Information); //return; } var inInterface = new T6Interface(); string sid = Grid1.DataKeys[Grid1.SelectedRowIndexArray[0]][0].ToString(); //材料出仓 string cate = Grid1.DataKeys[Grid1.SelectedRowIndexArray[0]][3].ToString(); if (cate.Equals("材料出仓")) { Alert.Show(inInterface.SubmitMaterialStockOut(sid, CurrentUser.AccountComId), "消息提示", MessageBoxIcon.Information); } else { Alert.Show(inInterface.SubmitStockOut(sid, CurrentUser.AccountComId), "消息提示", MessageBoxIcon.Information); } BindDataGrid(); } } catch (Exception) { Alert.Show("同步失败!", MessageBoxIcon.Warning); } }
protected void btnData_Click(object sender, EventArgs e) { try { if (Grid1.SelectedRowIndexArray.Length == 0) { Alert.Show("请至少选择一项!", MessageBoxIcon.Information); } else if (Grid1.SelectedRowIndexArray.Length > 1) { Alert.Show("只能选择一项!", MessageBoxIcon.Information); } else { //验证是否已作废 string flag = Grid1.DataKeys[Grid1.SelectedRowIndexArray[0]][1].ToString(); if (flag.Equals("0")) { Alert.Show("单据已作废,不允许上传", MessageBoxIcon.Information); return; } //验证是否已提交 string t6Status = Grid1.DataKeys[Grid1.SelectedRowIndexArray[0]][2].ToString(); if (t6Status.Equals("已同步")) { Alert.Show("单据已同步,不允许再次上传", MessageBoxIcon.Information); //return; } //无权上传该销售单据,该单据由业务员 string salesman = Grid1.DataKeys[Grid1.SelectedRowIndexArray[0]][3].ToString(); if (!salesman.Equals(CurrentUser.AccountName)) { Alert.Show("无权上传该销售单据,不允许上传他人业务订单", MessageBoxIcon.Information); return; } string sid = Grid1.DataKeys[Grid1.SelectedRowIndexArray[0]][0].ToString(); var inInterface = new T6Interface(); Alert.Show(inInterface.SubmitLossess(sid, CurrentUser.AccountComId), "消息提示", MessageBoxIcon.Information); BindDataGrid(); } } catch (Exception) { Alert.Show("同步失败!", MessageBoxIcon.Warning); } }