Пример #1
0
 public bool DelByIDS(string ids)
 {
     SafeSC.CheckIDSEx(ids);
     return(DBCenter.DelByIDS(TbName, PK, ids));
 }
Пример #2
0
 public bool Del(int ID)
 {
     return(DBCenter.Del(TbName, PK, ID));
 }
Пример #3
0
 public DataTable Sel()
 {
     return(DBCenter.Sel(TbName));
 }
Пример #4
0
 //--------------------
 public bool IsExist(double money)
 {
     //同种金额的不能重复添加
     return DBCenter.IsExist(TbName, "Min='" + money + "'");
 }
Пример #5
0
 public PageSetting SelPage(int cpage, int psize)
 {
     PageSetting setting = PageSetting.Single(cpage, psize, TbName, PK, "");
     DBCenter.SelPage(setting);
     return setting;
 }
Пример #6
0
 public bool UpdateByID(M_Shop_RegionPrice model)
 {
     return(DBCenter.UpdateByID(model, model.ID));
 }
Пример #7
0
        /// <summary>
        /// 輸入生產編號
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        protected void ttbLot_TextChanged(object sender, EventArgs e)
        {
            try
            {
                //確認是否有輸入資料
                ttbLot.Must(lblLot);

                #region 取得檢驗資料(查詢機台、序號、機加批號及鍛造批號欄位是否有符合介面輸入的資料,資料狀態必須為MPQC且判定結果為NULL)
                string sql = @"SELECT A.*, B.EQUIPMENT, B.PASSFLAG, B.BATCHID, B.DEVICE
                                  FROM MES_QC_INSP_OBJ A
                                       LEFT JOIN MES_QC_INSP B ON A.QC_INSP_SID = B.QC_INSP_SID
                                 WHERE (ITEM1 = #[STRING] OR ITEM2 = #[STRING] OR ITEM3 = #[STRING] OR EQUIPMENT = #[STRING]) 
                                    AND STATUS = 'MPQC'
                                    AND QCTYPE = 'MPQC' 
                                    AND RESULT IS NULL";

                var lot = CustomizeFunction.ConvertDMCCode(ttbLot.Text.Trim());

                var table = DBCenter.GetDataTable(sql, lot, lot, lot, lot);

                if (table.Rows.Count == 0)
                {
                    //生產編號:{0} 查無檢驗資料!
                    throw new Exception(RuleMessage.Error.C10062(lot));
                }

                //清除檢驗清單資料
                _QCDataList.Clear();

                foreach (DataRow dr in table.Rows)
                {
                    _QCDataList.Add(new QCData()
                    {
                        ID              = dr["QC_INSP_OBJ_SID"].ToString(),
                        EquipmentName   = dr["EQUIPMENT"].ToString(),
                        BatchID         = dr["BATCHID"].ToString(),
                        ComponentLot    = dr["ITEM1"].ToString(),
                        WorkOderLot     = dr["ITEM2"].ToString(),
                        MaterialLot     = dr["ITEM3"].ToString(),
                        ObjectSID       = dr["OBJECTSID"].ToString(),
                        PassFlag        = dr["PASSFLAG"].ToString(),
                        QCInspectionSID = dr["QC_INSP_SID"].ToString(),
                        DeviceName      = dr["DEVICE"].ToString()
                    });
                }
                #endregion

                #region 清除介面資料

                ddlPQCReasonCode.Items.Clear();
                ddlSN.Items.Clear();
                ddlEquip.Items.Clear();

                ttbMaterialLot.Text  = "";
                ttbDescr.Text        = "";
                ttbWorkOrderLot.Text = "";

                btnOK.Enabled = false;

                rdbOK.Checked = true;
                rdbNG.Checked = false;

                rdbOK.Enabled = true;
                rdbNG.Enabled = false;
                #endregion

                #region 設置機台資料

                //取得所有檢驗資料之不重複機台名稱
                foreach (var QCData in _QCDataList)
                {
                    ListItem newItem = new ListItem(QCData.EquipmentName, QCData.EquipmentName);

                    if (ddlEquip.Items.Contains(newItem) == false)
                    {
                        ddlEquip.Items.Add(newItem);
                    }
                }

                if (ddlEquip.Items.Count == 0)
                {
                    //生產編號:{0} 沒有機台可以選擇!
                    throw new Exception(RuleMessage.Error.C10063(lot));
                }

                if (ddlEquip.Items.Count != 1)
                {
                    ddlEquip.Items.Insert(0, "");
                }
                else
                {
                    ddlEquip.SelectedIndex = 0;
                    ddlEquip_SelectedIndexChanged(null, EventArgs.Empty);
                }
                #endregion
            }
            catch (Exception ex)
            {
                ClearField();
                AjaxFocus(ttbLot);
                HandleError(ex);
            }
        }
Пример #8
0
 public int insert(M_Student model)
 {
     return(DBCenter.Insert(model));
 }
Пример #9
0
 /// <summary>
 ///添加记录
 /// </summary>
 /// <param name="Student"></param>
 /// <returns></returns>
 public bool GetInsert(M_Student model)
 {
     return(DBCenter.Insert(model) > 0);
 }
Пример #10
0
 public void DelByIDS(string ids)
 {
     SafeSC.CheckIDSEx(ids);
     DBCenter.DelByIDS(TbName, PK, ids);
 }
Пример #11
0
        /// <summary>
        /// 鍛造出站有不良數量直接拆批及送待判工作站
        /// </summary>
        /// <param name="txnLotData">機加批號</param>
        /// <param name="defectGridDataList">不良清單</param>
        /// <param name="txnStamp"></param>
        public void SplitDefectLotList(LotInfoEx txnLotData, List <DefectGridData> defectGridDataList, TransactionStamp txnStamp)
        {
            //待判工作站點名稱
            string judgeOperationName = "";

            //確認是否有不良清單,如果有不良清單的話,則要取得待判工作站資料
            if (defectGridDataList.Count > 0)
            {
                //在系統資料維護裡,取得此批號對應製程(CPC/CPF)的待判工作站名稱
                List <WpcExClassItemInfo> operationList      = WpcExClassItemInfo.GetExtendItemListByClassAndRemarks("SAIJudgeOperation");
                WpcExClassItemInfo        judgeOperationData = operationList.Find(p => p.Remark01 == txnLotData.Process);
                if (judgeOperationData == null)
                {
                    //找不到待判站資訊,請至系統資料維護增加資訊,屬性:{0}
                    throw new Exception(RuleMessage.Error.C10014(txnLotData.Process));
                }

                //取得待判工作站名稱
                judgeOperationName = judgeOperationData.Remark02;
            }

            //處理不良批號
            defectGridDataList.ForEach(defectGridData =>
            {
                //取得原因碼資訊
                var reasonData = InfoCenter.GetBySID <ReasonCategoryInfo>(defectGridData.DefectID);

                //取得批號子單元資訊
                var component = ComponentInfo.GetComponentByComponentID(defectGridData.ComponentID);

                //取得不良子批批號名稱
                var splitLotNaming = GetNamingRule("SplitLot", txnStamp.UserID, txnLotData);

                //批號拆子批
                var splitLot = SplitLotInfo.CreateSplitLotByLotAndQuantity(txnLotData.Lot, splitLotNaming.First[0], new List <ComponentInfo>()
                {
                    component
                }, reasonData, reasonData.Description);
                WIPTxn.Default.SplitLot(txnLotData, splitLot, WIPTxn.SplitIndicator.Create(null, null, null, TerminateBehavior.NoTerminate), txnStamp);

                if (splitLotNaming.Second != null && splitLotNaming.Second.Count != 0)
                {
                    DBCenter.ExecuteSQL(splitLotNaming.Second);
                }

                //註記不良
                var compDefect = ComponentDefectObject.Create(component, component.ComponentQuantity, 0, reasonData, defectGridData.DefectDesc);
                WIPTransaction.DefectComponent(splitLot, new List <ComponentDefectObject>()
                {
                    compDefect
                }, WIPTransaction.DefectIndicator.Create(), txnStamp);

                #region 送至待判工作站

                //取得目前批號的流程線上版本
                RouteVersionInfo RouteVersion = RouteVersionInfo.GetRouteActiveVersion(txnLotData.RouteName);

                //以目前工作站名稱去查詢在所有流程中的序號
                var routeOperation = RouteOperationInfo.GetRouteAllOperations(RouteVersion).Find(p => p.OperationName == judgeOperationName);

                //以目前工作站名稱去查詢在所有流程中的序號
                var reasonCategory = ReasonCategoryInfo.GetReasonCategoryByCategoryNameAndReason("Common", "OTHER");

                ////將批號的UDC01註記不良批
                //WIPTransaction.ModifyLotSystemAttribute(splitLot, "USERDEFINECOL01", "Y", txnStamp);

                ////將批號的UDC02註記工作站序號
                //WIPTransaction.ModifyLotSystemAttribute(splitLot, "USERDEFINECOL02", operationSequence, txnStamp);

                ////將批號的UDC03註記工作站名稱
                //WIPTransaction.ModifyLotSystemAttribute(splitLot, "USERDEFINECOL03", operationName, txnStamp);

                var modifyAttrList = new List <ModifyLotAttributeInfo>();

                //將批號的UDC01註記不良批
                modifyAttrList.Add(ModifyLotAttributeInfo.CreateLotSystemAttributeInfo("USERDEFINECOL01", "Y"));

                //將批號的UDC02註記工作站序號
                modifyAttrList.Add(ModifyLotAttributeInfo.CreateLotSystemAttributeInfo("USERDEFINECOL02", splitLot.OperationSequence));

                //將批號的UDC03註記工作站名稱
                modifyAttrList.Add(ModifyLotAttributeInfo.CreateLotSystemAttributeInfo("USERDEFINECOL03", splitLot.OperationName));

                WIPTransaction.ModifyLotMultipleAttribute(splitLot, modifyAttrList, txnStamp);

                WIPTransaction.ReassignOperation(splitLot, routeOperation, reasonCategory, reasonCategory.Description, txnStamp);

                #endregion
            });
        }
Пример #12
0
 //------------Update
 public bool UpdateModel(M_Order_LuckCode model)
 {
     return(DBCenter.UpdateByID(model, model.ID));
 }
Пример #13
0
 //-----------------Insert
 public int Insert(M_Order_LuckCode model)
 {
     return(DBCenter.Insert(model));
 }
Пример #14
0
 public void DelByAnsID(string ansids)
 {
     SafeSC.CheckIDSEx(ansids);
     DBCenter.DelByWhere(TbName, "AnsID IN (" + ansids + ")");
 }
Пример #15
0
 public bool Add(M_Templata model)
 {
     return(DBCenter.Insert(model) > 0);
 }
Пример #16
0
 /// <summary>
 ///更新记录
 /// </summary>
 /// <param name="Student"></param>
 /// <returns></returns>
 public bool GetUpdate(M_Student model)
 {
     return(DBCenter.UpdateByID(model, model.Noteid));
 }
Пример #17
0
 /// <summary>
 /// 根据ID更新
 /// </summary>
 public bool UpdateByID(M_Templata model)
 {
     return(DBCenter.UpdateByID(model, model.TemplateID));
 }
Пример #18
0
 public DataTable Sel()
 {
     return(DBCenter.Sel(TbName, "", PK + " DESC"));
 }
Пример #19
0
 public int Insert(M_Shop_RegionPrice model)
 {
     return(DBCenter.Insert(model));
 }
Пример #20
0
 public int Insert(M_CRMS_Attr model)
 {
     return(DBCenter.Insert(model));
 }
Пример #21
0
 protected void Page_Load(object sender, EventArgs e)
 {
     dt = DBCenter.Sel("ZL_Pub_dzmb", "ID=" + Mid);
 }
Пример #22
0
 public bool UpdateByID(M_CRMS_Attr model)
 {
     return(DBCenter.UpdateByID(model, model.ID));
 }
Пример #23
0
 public int Insert(M_Shop_MoneyRegular model)
 {
     return DBCenter.Insert(model);
 }
Пример #24
0
 public bool UpdateByID(M_Cash model)
 {
     return(DBCenter.UpdateByID(model, model.Y_ID));
 }
Пример #25
0
 public bool UpdateByID(M_Shop_MoneyRegular model)
 {
     return DBCenter.UpdateByID(model, model.ID);
 }
Пример #26
0
 public int insert(M_Cash model)
 {
     return(DBCenter.Insert(model));
 }
Пример #27
0
 public int Insert(M_Design_AnsDetail model)
 {
     return(DBCenter.Insert(model));
 }
Пример #28
0
 public int insert(M_Templata model)
 {
     return(DBCenter.Insert(model));
 }
Пример #29
0
 public bool UpdateByID(M_Design_AnsDetail model)
 {
     return(DBCenter.UpdateByID(model, model.ID));
 }
Пример #30
0
        /// <summary>
        /// 用于查看问答详情
        /// </summary>
        public DataTable SelForQList(int qid)
        {
            string stable = "(SELECT A.*,B.UserName FROM ZL_Design_Answer A LEFT JOIN ZL_User B ON A.UserID=B.UserID)";

            return(DBCenter.JoinQuery("A.*,B.IP,B.Source,B.UserName", TbName, stable, "A.AnsID=B.ID", "A.Qid=" + qid, "A.ID DESC"));
        }