public ServerResponse <string> LockAuthority(JObject form)
 {
     if (_zl11Repository.GetCtrl("QSBN_LOCK", "01").drpValue.Contains(GetUser()))
     {
         return(ServerResponse <string> .CreateBySuccessMessage("OK!"));
     }
     else
     {
         return(ServerResponse <string> .CreateByErrorMessage("操作错误,仅关务有加锁和解锁的权限 !"));
     }
 }
 public ServerResponse <string> LockClick(JObject form)
 {
     try
     {
         _zl11Repository.LockClick(form["BUKRS"].ToString(), form["MATNR"].ToString(), form["Vendorcode"].ToString(), form["Type"].ToString(), form["LOCK"].ToString());
         return(ServerResponse <string> .CreateBySuccessMessage("Success"));
     }
     catch (Exception e)
     {
         return(ServerResponse <string> .CreateByErrorMessage("Error" + e.Message));
     }
 }
        public ServerResponse <string> Delete(JObject form)
        {
            JArray forms     = JArray.FromObject(form["data"]);
            var    delReason = form["delReason"].ToString();

            try
            {
                foreach (var data in forms)
                {
                    _zl11Repository.Delete(form["Type"].ToString(), form["MANDT"].ToString(),
                                           form["BUKRS"].ToString(), form["MATNR"].ToString(), form["Vendorcode"].ToString(), form["DECLITEM"].ToString(),
                                           GetUser(), delReason);
                }

                return(ServerResponse <string> .CreateBySuccessMessage("删除成功!"));
            }
            catch
            {
                return(ServerResponse <string> .CreateByErrorMessage("删除失败!"));
            }
        }
        public ServerResponse <string> Save(JArray form)
        {
            var    userName              = GetUser();
            string strBeiZhu             = "";
            bool   flag                  = false;
            IList <VIEW_spare_All> zl11s = form.ToObject <IList <VIEW_spare_All> >();

            foreach (var zl11 in zl11s)
            {
                zl11.CHNAME = userName;
                zl11.CHDATE = DateTime.Now.Date.ToString("yyyyMMdd");

                if (!zl11.Type.Equals("放弃退税") &&
                    _zl11Repository.CheckDiff(zl11.BUKRS, zl11.MATNR, zl11.SMAKTX, zl11.TAX_CODE, zl11.CGEWEI, zl11.DECLITEM) &&
                    !_zl11Repository.GetCtrl("QSBN_CheckDiff", "01").drpValue.Contains(userName))
                {
                    return(ServerResponse <string> .CreateByErrorMessage("料号" + zl11.MATNR + "备案不一致,请确认!"));
                }

                #region 国内Vendor Beizhu必填  境外Vendor 能效标识必填
                if (zl11.Vendorcode.Equals("QCI_MRO") || zl11.Vendorcode.Substring(zl11.Vendorcode.Length - 1, 1) == "F")
                {
                    if ((_tdsYitemRepository.Is3C(zl11.BUKRS, zl11.DECLITEM) & zl11.C3FLAG == "不涉及")
                        & (_tdsYitemRepository.IsEnergy(zl11.BUKRS, zl11.DECLITEM) & zl11.CELFLAG == "不涉及"))
                    {
                        strBeiZhu += "【" + zl11.BUKRS + ',' + zl11.DECLITEM + ',' + zl11.MATNR + "涉及3C验证;"
                                     + zl11.Vendorcode + ',' + zl11.MATNR + "涉及能效标识" + "】";
                    }
                    else if ((_tdsYitemRepository.Is3C(zl11.BUKRS, zl11.DECLITEM) & zl11.C3FLAG == "不涉及"))
                    {
                        strBeiZhu += "【" + zl11.BUKRS + ',' + zl11.DECLITEM + ',' + zl11.MATNR + "涉及3C验证】";
                    }
                    else if (_tdsYitemRepository.IsEnergy(zl11.BUKRS, zl11.DECLITEM) & zl11.CELFLAG == "不涉及")
                    {
                        strBeiZhu += "【" + zl11.BUKRS + ',' + zl11.Vendorcode + ',' + zl11.MATNR + "涉及能效标识" + "】";
                    }
                    else
                    {
                        if (zl11.BRGEW != "")//BRGEW zhengsui
                        {
                            strBeiZhu += "【" + zl11.BUKRS + ',' + zl11.Vendorcode + ',' + zl11.MATNR + "涉及" + zl11.BRGEW + "】";
                        }
                        flag = InsertMro(zl11);
                    }
                }
                else if (zl11.Vendorcode.Substring(zl11.Vendorcode.Length - 1, 1) == "L" ||
                         zl11.Vendorcode != "QCI_MRO")
                {
                    if (zl11.C3REMARK == "无备注")
                    {
                        strBeiZhu += "【" + zl11.BUKRS + ',' + zl11.Vendorcode + ',' + zl11.MATNR + "备注栏位必填" + "】";
                    }
                    else
                    {
                        flag = InsertMro(zl11);
                    }
                }

                #endregion
            }

            //todo...有问题,循环插入没办法判断是否保存成功
            if (flag)
            {
                return(ServerResponse <string> .CreateBySuccessMessage("Save Successfully" + strBeiZhu));
            }
            else
            {
                return(ServerResponse <string> .CreateByErrorMessage("Save Error" + strBeiZhu));
            }
        }