Ejemplo n.º 1
0
        /// <summary>
        /// 修改驳船分发规则
        /// </summary>
        /// <param name="row"></param>
        public void UpdateBarge(string companyCode, string shipAgent, string shipOwner)
        {
            if (string.IsNullOrEmpty(companyCode))
            {
                throw new Exception("请输入外理公司代码");
            }
            if (string.IsNullOrEmpty(shipAgent))
            {
                throw new Exception("请输入船代");
            }
            if (string.IsNullOrEmpty(shipOwner))
            {
                throw new Exception("请输入船东");
            }

            //较验船东
            bool isValid = ValidateBLL.CheckEnglishComma(shipOwner, 1, 10);

            if (!isValid)
            {
                throw new Exception("船东不合法。多个船东请用英文逗号隔开");
            }

            CheckOwners(shipOwner, shipAgent, companyCode);

            DataSet1.T_OCRX_BARGERow row = new DataSet1.T_OCRX_BARGEDataTable().NewT_OCRX_BARGERow();
            row.COMPANYCODE = companyCode;
            row.SHIPOWNER   = shipOwner;
            row.SHIPAGENT   = shipAgent;
            row.UPDATEDBY   = Config.UserId;

            DAL.cctdbDAL.UpdateBarge(row);
        }
Ejemplo n.º 2
0
        /// <summary>
        /// 新增班轮分发规则
        /// </summary>
        /// <param name="row"></param>
        public void InsertVessel(string companyCode, string serviceCode, string lineCode)
        {
            if (string.IsNullOrEmpty(companyCode))
            {
                throw new Exception("请输入外理公司代码");
            }
            if (string.IsNullOrEmpty(serviceCode))
            {
                throw new Exception("请输入航线");
            }
            if (string.IsNullOrEmpty(lineCode))
            {
                throw new Exception("请输入箱主");
            }

            //较验箱主
            bool isValid = ValidateBLL.CheckEnglishComma(lineCode, 1, 10);

            if (!isValid)
            {
                throw new Exception("箱主不合法。多个箱主请用英文逗号隔开");
            }

            CheckLines(lineCode, serviceCode, companyCode);

            DataSet1.T_OCRX_VESSELRow row = new DataSet1.T_OCRX_VESSELDataTable().NewT_OCRX_VESSELRow();
            row.COMPANYCODE = companyCode;
            row.SERVICECODE = serviceCode;
            row.LINECODE    = lineCode;
            row.CREATEDBY   = Config.UserId;

            DAL.cctdbDAL.InsertVessel(row);
        }
Ejemplo n.º 3
0
        /// <summary>
        /// 卸船确认数据校验
        /// </summary>
        /// <param name="row"></param>
        /// <returns></returns>
        public bool DisCheck(DataSet1.T_OCRX_CNTRow row)
        {
            string cntNo = GetCntNo(row);

            if (string.IsNullOrEmpty(cntNo))
            {
                throw new Exception("请输入箱号");
            }
            if (string.IsNullOrEmpty(cntCtrl.txtISO.Text.Trim()))
            {
                throw new Exception("请输入ISOCODE");
            }
            if (string.IsNullOrEmpty(cntCtrl.txtFle.Text.Trim()))
            {
                throw new Exception("请输入空重");
            }

            if (cntCtrl.ckbDanger.Checked && (string.IsNullOrEmpty(cntCtrl.txtImdg1.Text.Trim()) &&
                                              string.IsNullOrEmpty(cntCtrl.txtImdg1.Text.Trim()) && string.IsNullOrEmpty(cntCtrl.txtImdg1.Text.Trim())))
            {
                throw new Exception("请输入危标");
            }

            if (cntCtrl.ckbOOG.Checked && (string.IsNullOrEmpty(cntCtrl.txtOA.Text.Trim()) &&
                                           string.IsNullOrEmpty(cntCtrl.txtOF.Text.Trim()) && string.IsNullOrEmpty(cntCtrl.txtOH.Text.Trim()) &&
                                           string.IsNullOrEmpty(cntCtrl.txtOL.Text.Trim()) && string.IsNullOrEmpty(cntCtrl.txtOR.Text.Trim())))
            {
                throw new Exception("请输入超限值");
            }

            if (!string.IsNullOrEmpty(cntCtrl.txtOA.Text.Trim()) && !ValidateBLL.CheckNumber(cntCtrl.txtOA.Text.Trim(), 1, 999))
            {
                throw new Exception("OA,请输入正确的超限值");
            }
            if (!string.IsNullOrEmpty(cntCtrl.txtOF.Text.Trim()) && !ValidateBLL.CheckNumber(cntCtrl.txtOF.Text.Trim(), 1, 999))
            {
                throw new Exception("OF,请输入正确的超限值");
            }
            if (!string.IsNullOrEmpty(cntCtrl.txtOH.Text.Trim()) && !ValidateBLL.CheckNumber(cntCtrl.txtOH.Text.Trim(), 1, 999))
            {
                throw new Exception("OH,请输入正确的超限值");
            }
            if (!string.IsNullOrEmpty(cntCtrl.txtOL.Text.Trim()) && !ValidateBLL.CheckNumber(cntCtrl.txtOL.Text.Trim(), 1, 999))
            {
                throw new Exception("OL,请输入正确的超限值");
            }
            if (!string.IsNullOrEmpty(cntCtrl.txtOR.Text.Trim()) && !ValidateBLL.CheckNumber(cntCtrl.txtOR.Text.Trim(), 1, 999))
            {
                throw new Exception("OR,请输入正确的超限值");
            }

            //以船为单位,校验是否已经确认过
            using (DataTable dt = DAL.cctdbDAL.SelectCntConfirmed(row.ENAM, cntNo, row.DOCK_STATUS))
            {
                if (dt.Rows.Count > 0)
                {
                    string msg1 = string.Format("箱号{0} 已于 {1} 被 {2} 确认过!\r\n是否继续确认?", cntNo, Convert.ToDateTime(dt.Rows[0]["finishtime"]), dt.Rows[0]["operatorname"].ToString());

                    DialogResult drs = MessageBox.Show(msg1, "提示", MessageBoxButtons.YesNo, MessageBoxIcon.Question, MessageBoxDefaultButton.Button1);
                    return(drs == DialogResult.Yes);
                }
            }

            return(true);
        }