Пример #1
0
        private void SaveRowInfo(DataSet1.T_OCRX_CNTRow row)
        {
            row.RCONTAINER_NO    = row.IsRCONTAINER_NONull() ? string.Empty : row.RCONTAINER_NO;
            row.RCONTAINER_SHAPE = row.IsRCONTAINER_SHAPENull() ? string.Empty : row.RCONTAINER_SHAPE;
            row.LINECODE         = row.IsLINECODENull() ? string.Empty : row.LINECODE;

            row.BINDSEQ = Convert.ToDecimal(cntCtrl.txtBndl1.Text);

            row.ISOVERTOP = cntCtrl.ckbOOG.Checked ? "Y" : "N";
            row.OVA       = cntCtrl.ckbOOG.Checked && !String.IsNullOrEmpty(cntCtrl.txtOA.Text.Trim()) ? Convert.ToDecimal(cntCtrl.txtOA.Text.Trim()) : decimal.Zero;
            row.OVF       = cntCtrl.ckbOOG.Checked && !String.IsNullOrEmpty(cntCtrl.txtOF.Text.Trim()) ? Convert.ToDecimal(cntCtrl.txtOF.Text.Trim()) : decimal.Zero;
            row.OVH       = cntCtrl.ckbOOG.Checked && !String.IsNullOrEmpty(cntCtrl.txtOH.Text.Trim()) ? Convert.ToDecimal(cntCtrl.txtOH.Text.Trim()) : decimal.Zero;
            row.OVR       = cntCtrl.ckbOOG.Checked && !String.IsNullOrEmpty(cntCtrl.txtOR.Text.Trim()) ? Convert.ToDecimal(cntCtrl.txtOR.Text.Trim()) : decimal.Zero;
            row.OVL       = cntCtrl.ckbOOG.Checked && !String.IsNullOrEmpty(cntCtrl.txtOL.Text.Trim()) ? Convert.ToDecimal(cntCtrl.txtOL.Text.Trim()) : decimal.Zero;

            row.DMGMODIFIED = (cntCtrl.ckbIsDmg.Checked ? "Y" : "N") == row.ISDAMAGE ? "N" : "Y";
            row.ISDAMAGE    = cntCtrl.ckbIsDmg.Checked ? "Y" : "N";
            row.Dmg         = cntCtrl.ckbIsDmg.Checked ? cntCtrl.txtDmg.Text.Trim() : string.Empty;

            row.ISIMDG = cntCtrl.ckbDanger.Checked ? "Y" : "N";
            row.Imdg1  = cntCtrl.ckbDanger.Checked ? cntCtrl.txtImdg1.Text.Trim() : string.Empty;
            row.Imdg2  = cntCtrl.ckbDanger.Checked ? cntCtrl.txtImdg2.Text.Trim() : string.Empty;
            row.Imdg3  = cntCtrl.ckbDanger.Checked ? cntCtrl.txtImdg3.Text.Trim() : string.Empty;

            row.ISOVERDIS = "N";

            if (iso != null)
            {
                row.CONTAINER_SIZE   = iso.CONTAINERSIZE;
                row.CONTAINER_HEIGHT = iso.CONTAINERHEIGHT;
                row.CONTAINERTYPE    = iso.CONTAINERTYPE;
            }
            else
            {
                row.CONTAINER_HEIGHT = 0;
                row.CONTAINERTYPE    = string.Empty;
            }
        }
Пример #2
0
        /// <summary>
        /// 填充装卸确认UI
        /// </summary>
        /// <param name="row"></param>
        public CtosResult InitCntCtrl(DataSet1.T_OCRX_CNTRow row)
        {
            //if (row == null)
            //{
            //    throw new Exception("缺少第二条识别记录!");
            //}

            ClearSpcData();

            //第二个柜以上的装卸以第一个柜为准
            if (Convert.ToDecimal(cntCtrl.txtMove1.Text) <= 1 && Convert.ToDecimal(cntCtrl.txtBndl1.Text) <= 1)
            {
                cntCtrl.rbnLoad.Checked = row.DOCK_STATUS == 0;
            }
            else
            {
                row.DOCK_STATUS = cntCtrl.rbnLoad.Checked ? 0 : 1;
            }

            cntCtrl.txtContNo.Enabled = true;

            string cntNo = !string.IsNullOrEmpty(row.RCONTAINER_NO) ? row.RCONTAINER_NO : row.CONTAINER_NO;

            cntCtrl.numMoves.Value = (row.IsCTYPENull() ? 0 : row.CTYPE) + 1;
            if (row2 == null)
            {
                cntCtrl.numMoves.Value = 1;
            }
            cntCtrl.txtContNo.Text = cntNo;
            cntCtrl.txtISO.Text    = row.CONTAINER_SHAPE;

            cntCtrl.lblPicNum.Text = row.IsPIC_NUMNull() ? "0" : row.PIC_NUM.ToString();

            //QC作业配置
            qc = OCR.DAL.cctdbDAL.SelectQCSet(row.TRVAL_NO);

            //if (qc == null)
            //{
            //    throw new Exception(string.Format("桥吊{0}缺少作业配置", qc.TRVALCRANE_NO));
            //}

            //if (qc.STATUS != "作业中")
            //{
            //    throw new Exception(string.Format("桥吊{0}的作业配置状态有误", qc.TRVALCRANE_NO));
            //}

            cntCtrl.lblBerth.Text     = row.BERTH_NUM;
            cntCtrl.lblLinecode.Text  = row.IsLINECODENull() ? string.Empty : row.LINECODE;
            cntCtrl.lblService.Text   = row.IsSERVICECODENull() ? string.Empty : row.SERVICECODE;
            cntCtrl.lblShipAgent.Text = row.IsSHIPAGENTNull() ? string.Empty : row.SHIPAGENT;
            cntCtrl.lblVessel.Text    = row.SHIP_CODE;
            cntCtrl.lblVoyage.Text    = row.C_VOYAGE;

            //从CTOS查找该箱其他信息
            if (cntNo != "未识别")
            {
                //查箱信息
                cntInfo = OCR.BLL.CtosAPIBLL.CM005001(cntNo, qc.TICKET_ID);

                //分装卸处理
                if (IsLoad())
                {
                    //装
                    cntCtrl.rbnLoad.Checked = true;
                }
                else
                {
                    //卸
                    cntCtrl.rbnLoad.Checked = false;
                }

                if (cntInfo.ERRORCODE != CtosAPIBLL.SUCCESSCODE || cntInfo.DS.Tables[0].Rows.Count == 0)
                {
                    cntCtrl.txtContNo.ForeColor = Color.Red;
                    return(null);
                }

                cntCtrl.txtContNo.ForeColor = Color.Black;

                cntCtrl.txtFle.Text     = cntInfo.DS.Tables["CM_CONTAINERS"].Rows[0]["EMPTYFULL"].ToString();
                row.EMPTYFULL           = cntInfo.DS.Tables["CM_CONTAINERS"].Rows[0]["EMPTYFULL"].ToString();
                cntCtrl.lblLoadPos.Text = cntInfo.DS.Tables["CM_CONTAINERS"].Rows[0]["PLANVESSELCELL"].ToString();


                cntCtrl.ckbDanger.Checked = cntInfo.DS.Tables["CM_CONTAINERS"].Rows[0]["ISIMDG"].ToString() == "Y";
                cntCtrl.ckbIsDmg.Checked  = cntInfo.DS.Tables["CM_CONTAINERS"].Rows[0]["ISDAMAGE"].ToString() == "Y";
                cntCtrl.ckbOOG.Checked    = cntInfo.DS.Tables["CM_CONTAINERS"].Rows[0]["ISOVERTOP"].ToString() == "Y";
                row.ISREEF    = cntInfo.DS.Tables["CM_CONTAINERS"].Rows[0]["ISREEF"].ToString();
                row.ISIMDG    = cntInfo.DS.Tables["CM_CONTAINERS"].Rows[0]["ISIMDG"].ToString();
                row.ISDAMAGE  = cntInfo.DS.Tables["CM_CONTAINERS"].Rows[0]["ISDAMAGE"].ToString();
                row.ISOVERTOP = cntInfo.DS.Tables["CM_CONTAINERS"].Rows[0]["ISOVERTOP"].ToString();
                row.ISBIND    = cntInfo.DS.Tables["CM_CONTAINERS"].Rows[0]["ISBIND"].ToString();

                row.INAIM            = cntInfo.DS.Tables["CM_CONTAINERS"].Rows[0]["INAIM"].ToString();
                row.CONTAINERTYPE    = cntInfo.DS.Tables["CM_CONTAINERS"].Rows[0]["CONTAINERTYPE"].ToString();
                row.CONTAINER_HEIGHT = Convert.ToDecimal(cntInfo.DS.Tables["CM_CONTAINERS"].Rows[0]["CONTAINERHEIGHT"]);
                row.CONTAINER_SIZE   = Convert.ToDecimal(cntInfo.DS.Tables["CM_CONTAINERS"].Rows[0]["CONTAINERSIZE"]);
                row.FORMLOCK         = cntInfo.DS.Tables["CM_CONTAINERS"].Rows[0]["FORMLOCK"].ToString();
                row.TERMINALLOCK     = cntInfo.DS.Tables["CM_CONTAINERS"].Rows[0]["TERMINALLOCK"].ToString();
                row.LOCTYPE          = cntInfo.DS.Tables["CM_CONTAINERS"].Rows[0]["LOCTYPE"].ToString();

                if (cntInfo.DS.Tables["CM_CONTAINERS"].Columns.Contains("CONTAINEROWNER"))
                {
                    row.LINECODE = cntInfo.DS.Tables["CM_CONTAINERS"].Rows[0]["CONTAINEROWNER"].ToString();
                }
                if (row.ISOVERTOP == "Y")
                {
                    cntCtrl.txtOF.Text = cntInfo.DS.Tables["CM_CONTAINERS"].Rows[0]["OVERFRONT"].ToString();
                    cntCtrl.txtOA.Text = cntInfo.DS.Tables["CM_CONTAINERS"].Rows[0]["OVERBEHIND"].ToString();
                    cntCtrl.txtOL.Text = cntInfo.DS.Tables["CM_CONTAINERS"].Rows[0]["OVERLEFT"].ToString();
                    cntCtrl.txtOR.Text = cntInfo.DS.Tables["CM_CONTAINERS"].Rows[0]["OVERRIGHT"].ToString();
                    cntCtrl.txtOH.Text = cntInfo.DS.Tables["CM_CONTAINERS"].Rows[0]["OVERTOP"].ToString();
                }

                row.ISOVERDIS = cntInfo.DS.Tables["CM_CONTAINERS"].Rows[0]["ISOVERFLOW"].ToString();
                if (row.ISOVERDIS == "N" && row.LOCTYPE == "V" && row.INAIM == "S")
                {
                    //如果在船上,且不是溢卸,要增加判断进港类型,如果是S,应判断为溢卸
                    row.ISOVERDIS = "Y";
                }

                //危标
                //危标等级
                if (cntInfo.DS.Tables.Contains("CM_CONTAINERIMDGINFO"))
                {
                    try
                    {
                        int i = 1;
                        foreach (DataRow drDanger in cntInfo.DS.Tables["CM_CONTAINERIMDGINFO"].Rows)
                        {
                            switch (i)
                            {
                            case 1:
                                cntCtrl.txtImdg1.Text = drDanger["IMDGLEVEL"].ToString();
                                break;

                            case 2:
                                cntCtrl.txtImdg2.Text = drDanger["IMDGLEVEL"].ToString();
                                break;

                            case 3:
                                cntCtrl.txtImdg3.Text = drDanger["IMDGLEVEL"].ToString();
                                break;
                            }
                            i++;
                        }
                    }
                    catch { }
                }

                //不自动带出打捆柜数量
                if (cntInfo.DS.Tables[1].Rows.Count > 1 && IsLoad())
                {
                    cntCtrl.numBndl.Value = cntInfo.DS.Tables["CM_CONTAINERS_BINDINFO"].Rows.Count + 1;
                    cntCtrl.txtBndl1.Text = "1";
                    row.MAINCONTAINERNO   = cntNo; //主箱号
                }
                else if (IsLoad())
                {
                    cntCtrl.numBndl.Value = 1;
                    cntCtrl.txtBndl1.Text = "0";
                    row.MAINCONTAINERNO   = string.Empty;
                }

                return(cntInfo);
            }

            return(null);
        }