Exemplo n.º 1
0
        protected object GetEditObject()
        {
            if (_facade == null)
            {
                _facade = new SPCFacade(base.DataProvider);
            }
            SPCObjectStore spcObj = (SPCObjectStore)_facade.GetSPCObjectStore(FormatHelper.PKCapitalFormat(FormatHelper.CleanString(this.txtObjectCode.Text)),
                                                                              Convert.ToDecimal(this.txtGroupIndex.Text),
                                                                              FormatHelper.PKCapitalFormat(FormatHelper.CleanString(this.txtCKGroup.Text)),
                                                                              FormatHelper.CleanString(this.txtCKItemCode.Text));

            if (spcObj == null)
            {
                spcObj = this._facade.CreateNewSPCObjectStore();
            }

            spcObj.ObjectCode   = this.txtObjectCode.Text;
            spcObj.GroupSeq     = Convert.ToDecimal(this.txtGroupIndex.Text);
            spcObj.CKGroup      = this.txtCKGroup.Text;
            spcObj.CKItemCode   = this.txtCKItemCode.Text;
            spcObj.MaintainUser = this.GetUserCode();
            spcObj.MaintainDate = FormatHelper.TODateInt(DateTime.Today);
            spcObj.MaintainTime = FormatHelper.TOTimeInt(DateTime.Now);

            return(spcObj);
        }
Exemplo n.º 2
0
        protected DataRow GetGridRow(object obj)
        {
            SPCObjectStore spcObj = (SPCObjectStore)obj;
            //spcObj.eAttribute1 = this.txtObjectName.Text;
            //return new Infragistics.WebUI.UltraWebGrid.UltraGridRow(
            //    new object[]{"false",
            //                    spcObj.Serial,
            //                    this.txtObjectCode.Text,
            //                    this.txtObjectName.Text,
            //                    spcObj.GroupSeq,
            //                    spcObj.CKGroup,
            //                    spcObj.CKItemCode,
            //                    spcObj.MaintainUser,
            //                    FormatHelper.ToDateString(spcObj.MaintainDate),
            //                    FormatHelper.ToTimeString(spcObj.MaintainTime),
            //                    ""});
            DataRow row = this.DtSource.NewRow();

            row["Serial"]         = spcObj.Serial;
            row["SPCControlItem"] = this.txtObjectCode.Text;
            row["ObjectName"]     = this.txtObjectName.Text;
            row["GroupSeq"]       = spcObj.GroupSeq;
            row["CheckGroup"]     = spcObj.CKGroup;
            row["CHECKITEMLIST"]  = spcObj.CKItemCode;
            row["MaintainUser"]   = spcObj.MaintainUser;
            row["MaintainDate"]   = FormatHelper.ToDateString(spcObj.MaintainDate);
            row["MaintainTime"]   = FormatHelper.ToTimeString(spcObj.MaintainTime);
            return(row);
        }
Exemplo n.º 3
0
        protected List <SPCObjectStore> GetEditObjects()
        {
            if (_facade == null)
            {
                _facade = new SPCFacade(base.DataProvider);
            }

            SPCObjectStore        spcObj;
            List <SPCObjectStore> spcObjList = new List <SPCObjectStore>();

            if (this.txtCKItemCode.Text == "")
            {
                OQCFacade _OQCFacade  = new OQCFacade(base.DataProvider);
                object[]  CKItemCodes = _OQCFacade.GetOQCCheckListByCheckGroup(this.txtCKGroup.Text);
                if (CKItemCodes != null)
                {
                    foreach (OQCCheckListQuery item in CKItemCodes)
                    {
                        spcObj            = new SPCObjectStore();
                        spcObj.CKItemCode = item.CheckItemCode;

                        spcObj.ObjectCode = this.txtObjectCode.Text;
                        spcObj.GroupSeq   = Convert.ToDecimal(this.txtGroupIndex.Text);
                        spcObj.CKGroup    = this.txtCKGroup.Text;

                        spcObj.MaintainUser = this.GetUserCode();
                        spcObj.MaintainDate = FormatHelper.TODateInt(DateTime.Today);
                        spcObj.MaintainTime = FormatHelper.TOTimeInt(DateTime.Now);
                        spcObjList.Add(spcObj);
                    }
                }
            }
            else
            {
                string[] ckItemCodes = this.txtCKItemCode.Text.Split(',');
                foreach (string str in ckItemCodes)
                {
                    spcObj            = new SPCObjectStore();
                    spcObj.CKItemCode = str;

                    spcObj.ObjectCode = this.txtObjectCode.Text;
                    spcObj.GroupSeq   = Convert.ToDecimal(this.txtGroupIndex.Text);
                    spcObj.CKGroup    = this.txtCKGroup.Text;

                    spcObj.MaintainUser = this.GetUserCode();
                    spcObj.MaintainDate = FormatHelper.TODateInt(DateTime.Today);
                    spcObj.MaintainTime = FormatHelper.TOTimeInt(DateTime.Now);
                    spcObjList.Add(spcObj);
                }
            }

            return(spcObjList);
        }
Exemplo n.º 4
0
        protected string[] FormatExportRecord(object obj)
        {
            SPCObjectStore spcObj = (SPCObjectStore)obj;

            //spcObj.eAttribute1 = this.txtObjectName.Text;
            return(new string[] { this.txtObjectCode.Text,
                                  this.txtObjectName.Text,
                                  spcObj.GroupSeq.ToString(),
                                  spcObj.CKGroup,
                                  spcObj.CKItemCode,
                                  spcObj.MaintainUser,
                                  FormatHelper.ToDateString(spcObj.MaintainDate),
                                  FormatHelper.ToTimeString(spcObj.MaintainTime) });
        }
Exemplo n.º 5
0
        protected void SetEditObject(object obj)
        {
            if (obj == null)
            {
                this.txtGroupIndex.Text = "0";
                this.txtCKGroup.Text    = "";
                this.txtCKItemCode.Text = "";

                return;
            }

            SPCObjectStore spcObj = (SPCObjectStore)obj;

            this.txtGroupIndex.Text = spcObj.GroupSeq.ToString();
            this.txtCKGroup.Text    = spcObj.CKGroup.ToString();
            this.txtCKItemCode.Text = spcObj.CKItemCode.ToString();
        }
Exemplo n.º 6
0
        /// <summary>
        /// 查询产品控制对象的数据存储栏位索引
        /// </summary>
        /// <returns></returns>
        public int GetDataColumnIndex(string itemCode, string spcObjectCode, decimal groupSequence)
        {
            if (htSpcDataIdx == null)
            {
                htSpcDataIdx = new Hashtable();
            }
            string strKey = itemCode + "||" + spcObjectCode + "||" + Convert.ToInt32(groupSequence).ToString();

            if (htSpcDataIdx.ContainsKey(strKey) == true)
            {
                return(Convert.ToInt32(htSpcDataIdx[strKey]));
            }
            else
            {
                string   strSql = "SELECT * FROM TBLSPCOBJECTSTORE WHERE ObjectCode='" + spcObjectCode + "' AND GroupSeq=" + groupSequence.ToString();
                object[] objs   = this.DataProvider.CustomQuery(typeof(SPCObjectStore), new SQLCondition(strSql));
                if (objs != null && objs.Length > 0)
                {
                    SPCObjectStore spcStore = (SPCObjectStore)objs[0];
                    //return Convert.ToInt32(spcStore.StoreColumn);
                }
            }
            return(-1);
        }
Exemplo n.º 7
0
 public void DeleteSPCObjectStore(SPCObjectStore sPCObjectStore)
 {
     this._helper.DeleteDomainObject(sPCObjectStore);
 }
Exemplo n.º 8
0
 public void UpdateSPCObjectStore(SPCObjectStore sPCObjectStore)
 {
     this._helper.UpdateDomainObject(sPCObjectStore);
 }
Exemplo n.º 9
0
 public void AddSPCObjectStore(SPCObjectStore sPCObjectStore)
 {
     this._helper.AddDomainObject(sPCObjectStore);
 }