Пример #1
0
        public void LoadOWCChart()
        {
            _UserOWCPivotTable.SetDataSource(_DataSource, GetOWCSchema());
            _UserOWCPivotTable.ClearFieldSet();

            foreach (string property in _RowPropertyList)
            {
                _UserOWCPivotTable.AddRowFieldSet(property, true);
            }

            foreach (string property in _ColumnPropertyList)
            {
                _UserOWCPivotTable.AddColumnFieldSet(property, true);
            }

            for (int i = 0; i < _DataPropertyList.Length; i++)
            {
                string property = _DataPropertyList[i];

                string format = string.Empty;
                if (i < _DataPropertyFormatList.Length)
                {
                    format = _DataPropertyFormatList[i];
                }

                if (_IsPercent)
                {
                    _UserOWCPivotTable.AddTotalField(_LanguageComponent.GetString(property), property, PivotTotalFunctionType.Sum, NumberFormat.Percent);
                }
                else if (format.Trim().Length > 0)
                {
                    _UserOWCPivotTable.AddTotalField(_LanguageComponent.GetString(property), property, PivotTotalFunctionType.Sum, format);
                }
                else
                {
                    _UserOWCPivotTable.AddTotalField(_LanguageComponent.GetString(property), property, PivotTotalFunctionType.Sum);
                }
            }

            _UserOWCChart.DataSource = _UserOWCPivotTable.PivotTableName;

            if (_UserOWCChartType == NewReportDisplayType.LineChart)
            {
                _UserOWCChart.ChartType = OWCChartType.LineMarkers;
            }
            else if (_UserOWCChartType == NewReportDisplayType.HistogramChart)
            {
                _UserOWCChart.ChartType = OWCChartType.ColumnClustered;
            }
            else if (_UserOWCChartType == NewReportDisplayType.PieChart)
            {
                _UserOWCChart.ChartType = OWCChartType.Pie;
            }
        }
Пример #2
0
        public static string TranslateParseType(string parseType, LanguageComponent languageComponent1)
        {
            string returnValue = string.Empty;

            string[] parseTypeList = parseType.Trim().ToLower().Split(new char[] { ',' });

            if (parseTypeList != null)
            {
                foreach (string part in parseTypeList)
                {
                    returnValue += "," + languageComponent1.GetString(part.Trim().ToLower());

                    //if (part == OPBOMDetailParseType.PARSE_PRODUCT && checkStatus)
                    //{
                    //    returnValue += "(" + languageComponent1.GetString("parse_product_checkstatus") + ")";
                    //}
                }
            }
            if (returnValue.Length > 0)
            {
                returnValue = returnValue.Substring(1);
            }

            return(returnValue);
        }
Пример #3
0
        private string Translate(string key)
        {
            string returnValue = key;

            object obj = _LanguageTable[key];

            if (obj == null)
            {
                if (_LanguageComponent != null)
                {
                    string lang = _LanguageComponent.GetString(key);
                    if (lang.Trim().Length > 0)
                    {
                        returnValue = lang;
                        _LanguageTable.Add(key, lang);
                    }
                }
            }
            else
            {
                returnValue = obj.ToString();
            }


            return(returnValue);
        }
Пример #4
0
        public static string TranslateCheckType(string checkType, LanguageComponent languageComponent1)
        {
            string returnValue = string.Empty;

            string[] checkTypeList = checkType.Trim().ToLower().Split(new char[] { ',' });

            if (checkTypeList != null)
            {
                foreach (string part in checkTypeList)
                {
                    returnValue += "," + languageComponent1.GetString(part.Trim().ToLower());
                }
            }
            if (returnValue.Length > 0)
            {
                returnValue = returnValue.Substring(1);
            }

            return(returnValue);
        }
Пример #5
0
        private void CheckWorkPlan()
        {
            int              count            = this._ImportDataTable.Rows.Count;
            Hashtable        checkedRow       = new Hashtable();
            ShiftModelFacade shiftModelFacade = new ShiftModelFacade(this._DataProvider);
            MaterialFacade   materialFacade   = new MaterialFacade(this._DataProvider);
            DBDateTime       dbDateTime       = FormatHelper.GetNowDBDateTime(this._DataProvider);

            for (int i = count - 1; i >= 0; i--)
            {
                DataRow    row           = this._ImportDataTable.Rows[i];
                GridRecord gridRow       = this._ImportGridRow[i] as GridRecord;
                string     moCode        = row["MOCODE"].ToString();
                string     bigSSCode     = row["BIGSSCODE"].ToString();
                string     planDate      = row["PLANDATE"].ToString();
                string     planSeq       = row["PLANSEQ"].ToString();
                string     moSeq         = row["MOSEQ"].ToString();
                string     planStartTime = (Convert.ToDateTime(row["PLANSTARTTIME"])).ToString("HH:mm:ss");
                string     planQty       = row["PLANQTY"].ToString();


                if (string.IsNullOrEmpty(moCode))
                {
                    if (!checkedRow.ContainsKey(moCode))
                    {
                        checkedRow.Add(moCode, false);
                    }

                    gridRow.Items.FindItemByKey(gridHelper.CheckColumnKey).Value = false;
                    gridRow.Items.FindItemByKey("ImportResult").Text             = _LanguageComponent1.GetString("$CS_MO_NotExit");
                    gridRow.Items.FindItemByKey("ImportResult").CssClass         = "MsgYellow";
                    this._ImportDataTable.Rows.Remove(row);
                    this._ImportGridRow.Remove(gridRow);
                    continue;
                }

                if (string.IsNullOrEmpty(bigSSCode))
                {
                    if (!checkedRow.ContainsKey(bigSSCode))
                    {
                        checkedRow.Add(bigSSCode, false);
                    }

                    gridRow.Items.FindItemByKey(gridHelper.CheckColumnKey).Value = false;
                    gridRow.Items.FindItemByKey("ImportResult").Text             = _LanguageComponent1.GetString("$BIGSSCODE_IS_NOT_EXIT");
                    gridRow.Items.FindItemByKey("ImportResult").CssClass         = "MsgYellow";
                    this._ImportDataTable.Rows.Remove(row);
                    this._ImportGridRow.Remove(gridRow);

                    continue;
                }

                if (string.IsNullOrEmpty(planDate))
                {
                    if (!checkedRow.ContainsKey(planDate))
                    {
                        checkedRow.Add(planDate, false);
                    }

                    gridRow.Items.FindItemByKey(gridHelper.CheckColumnKey).Value = false;
                    gridRow.Items.FindItemByKey("ImportResult").Text             = "计划日期不能为空";
                    gridRow.Items.FindItemByKey("ImportResult").CssClass         = "MsgYellow";
                    this._ImportDataTable.Rows.Remove(row);
                    this._ImportGridRow.Remove(gridRow);

                    continue;
                }

                try
                {
                    DateTime planDateTime = Convert.ToDateTime(FormatHelper.ToDateString(int.Parse(planDate), "-"));
                }
                catch
                {
                    if (!checkedRow.ContainsKey(planDate))
                    {
                        checkedRow.Add(planDate, false);
                    }

                    gridRow.Items.FindItemByKey(gridHelper.CheckColumnKey).Value = false;
                    gridRow.Items.FindItemByKey("ImportResult").Text             = "计划日期错误";
                    gridRow.Items.FindItemByKey("ImportResult").CssClass         = "MsgYellow";
                    this._ImportDataTable.Rows.Remove(row);
                    this._ImportGridRow.Remove(gridRow);

                    continue;
                }

                if (string.IsNullOrEmpty(planSeq))
                {
                    if (!checkedRow.ContainsKey(planSeq))
                    {
                        checkedRow.Add(planSeq, false);
                    }

                    gridRow.Items.FindItemByKey(gridHelper.CheckColumnKey).Value = false;
                    gridRow.Items.FindItemByKey("ImportResult").Text             = "生产顺序不能为空";
                    gridRow.Items.FindItemByKey("ImportResult").CssClass         = "MsgYellow";
                    this._ImportDataTable.Rows.Remove(row);
                    this._ImportGridRow.Remove(gridRow);

                    continue;
                }

                if (string.IsNullOrEmpty(moSeq))
                {
                    if (!checkedRow.ContainsKey(moSeq))
                    {
                        checkedRow.Add(moSeq, false);
                    }

                    gridRow.Items.FindItemByKey(gridHelper.CheckColumnKey).Value = false;
                    gridRow.Items.FindItemByKey("ImportResult").Text             = "工单项次不能为空";
                    gridRow.Items.FindItemByKey("ImportResult").CssClass         = "MsgYellow";
                    this._ImportDataTable.Rows.Remove(row);
                    this._ImportGridRow.Remove(gridRow);

                    continue;
                }

                if (string.IsNullOrEmpty(planStartTime))
                {
                    if (!checkedRow.ContainsKey(planStartTime))
                    {
                        checkedRow.Add(planStartTime, false);
                    }

                    gridRow.Items.FindItemByKey(gridHelper.CheckColumnKey).Value = false;
                    gridRow.Items.FindItemByKey("ImportResult").Text             = "计划开始时间不能为空";
                    gridRow.Items.FindItemByKey("ImportResult").CssClass         = "MsgYellow";
                    this._ImportDataTable.Rows.Remove(row);
                    this._ImportGridRow.Remove(gridRow);

                    continue;
                }


                try
                {
                    int numplanSeq = int.Parse(planSeq);
                    if (numplanSeq < 0)
                    {
                        if (!checkedRow.ContainsKey(planSeq))
                        {
                            checkedRow.Add(planSeq, false);
                        }

                        gridRow.Items.FindItemByKey(gridHelper.CheckColumnKey).Value = false;
                        gridRow.Items.FindItemByKey("ImportResult").Text             = "生产顺序不应小于0";
                        gridRow.Items.FindItemByKey("ImportResult").CssClass         = "MsgYellow";
                        this._ImportDataTable.Rows.Remove(row);
                        this._ImportGridRow.Remove(gridRow);

                        continue;
                    }
                }
                catch
                {
                    if (!checkedRow.ContainsKey(planSeq))
                    {
                        checkedRow.Add(planSeq, false);
                    }

                    gridRow.Items.FindItemByKey(gridHelper.CheckColumnKey).Value = false;
                    gridRow.Items.FindItemByKey("ImportResult").Text             = "生产顺序格式错误";
                    gridRow.Items.FindItemByKey("ImportResult").CssClass         = "MsgYellow";
                    this._ImportDataTable.Rows.Remove(row);
                    this._ImportGridRow.Remove(gridRow);

                    continue;
                }

                try
                {
                    int nummoSeq = int.Parse(moSeq);
                    if (nummoSeq < 0)
                    {
                        if (!checkedRow.ContainsKey(moSeq))
                        {
                            checkedRow.Add(moSeq, false);
                        }

                        gridRow.Items.FindItemByKey(gridHelper.CheckColumnKey).Value = false;
                        gridRow.Items.FindItemByKey("ImportResult").Text             = "工单项次不应小于0";
                        gridRow.Items.FindItemByKey("ImportResult").CssClass         = "MsgYellow";
                        this._ImportDataTable.Rows.Remove(row);
                        this._ImportGridRow.Remove(gridRow);

                        continue;
                    }
                }
                catch
                {
                    if (!checkedRow.ContainsKey(moSeq))
                    {
                        checkedRow.Add(moSeq, false);
                    }

                    gridRow.Items.FindItemByKey(gridHelper.CheckColumnKey).Value = false;
                    gridRow.Items.FindItemByKey("ImportResult").Text             = "工单项次格式错误";
                    gridRow.Items.FindItemByKey("ImportResult").CssClass         = "MsgYellow";
                    this._ImportDataTable.Rows.Remove(row);
                    this._ImportGridRow.Remove(gridRow);

                    continue;
                }

                try
                {
                    decimal numplanQty = decimal.Parse(planQty);
                    if (numplanQty < 0)
                    {
                        if (!checkedRow.ContainsKey(planQty))
                        {
                            checkedRow.Add(planQty, false);
                        }

                        gridRow.Items.FindItemByKey(gridHelper.CheckColumnKey).Value = false;
                        gridRow.Items.FindItemByKey("ImportResult").Text             = "计划数量不应小于0";
                        gridRow.Items.FindItemByKey("ImportResult").CssClass         = "MsgYellow";
                        this._ImportDataTable.Rows.Remove(row);
                        this._ImportGridRow.Remove(gridRow);

                        continue;
                    }
                }
                catch
                {
                    if (!checkedRow.ContainsKey(planQty))
                    {
                        checkedRow.Add(planQty, false);
                    }

                    gridRow.Items.FindItemByKey(gridHelper.CheckColumnKey).Value = false;
                    gridRow.Items.FindItemByKey("ImportResult").Text             = "计划数量格式错误";
                    gridRow.Items.FindItemByKey("ImportResult").CssClass         = "MsgYellow";
                    this._ImportDataTable.Rows.Remove(row);
                    this._ImportGridRow.Remove(gridRow);
                    continue;
                }

                //planDate
                try
                {
                    int numplanDate = FormatHelper.TODateInt(planDate.Insert(4, "-").Insert(7, "-"));
                }
                catch
                {
                    if (!checkedRow.ContainsKey(planDate))
                    {
                        checkedRow.Add(planDate, false);
                    }

                    gridRow.Items.FindItemByKey(gridHelper.CheckColumnKey).Value = false;
                    gridRow.Items.FindItemByKey("ImportResult").Text             = "计划日期格式错误";
                    gridRow.Items.FindItemByKey("ImportResult").CssClass         = "MsgYellow";
                    this._ImportDataTable.Rows.Remove(row);
                    this._ImportGridRow.Remove(gridRow);
                    continue;
                }

                //planStartTime
                try
                {
                    int numplanStartTime = FormatHelper.TOTimeInt(planStartTime.ToString());
                }
                catch
                {
                    if (!checkedRow.ContainsKey(planStartTime))
                    {
                        checkedRow.Add(planStartTime, false);
                    }

                    gridRow.Items.FindItemByKey(gridHelper.CheckColumnKey).Value = false;
                    gridRow.Items.FindItemByKey("ImportResult").Text             = "计划开始时间格式错误";
                    gridRow.Items.FindItemByKey("ImportResult").CssClass         = "MsgYellow";
                    this._ImportDataTable.Rows.Remove(row);
                    this._ImportGridRow.Remove(gridRow);
                    continue;
                }

                int shiftDay = shiftModelFacade.GetShiftDayByBigSSCode(bigSSCode, dbDateTime.DateTime);

                object[] objs = _DataProvider.CustomQuery(typeof(BenQGuru.eMES.Domain.MOModel.Model),
                                                          new SQLParamCondition(@"select mocode from tblmo where 1=1 " + GlobalVariables.CurrentOrganizations.GetSQLCondition() + @" and mocode=$MOCODE", new SQLParameter[] { new SQLParameter("$MOCODE", typeof(string), moCode.ToUpper()) }));

                if (objs == null)
                {
                    if (!checkedRow.ContainsKey(moCode))
                    {
                        checkedRow.Add(moCode, false);
                    }

                    gridRow.Items.FindItemByKey(gridHelper.CheckColumnKey).Value = false;
                    gridRow.Items.FindItemByKey("ImportResult").Text             = _LanguageComponent1.GetString("$CS_MO_NotExit");
                    gridRow.Items.FindItemByKey("ImportResult").CssClass         = "MsgYellow";
                    this._ImportDataTable.Rows.Remove(row);
                    this._ImportGridRow.Remove(gridRow);

                    continue;
                }

                object[] objss = _DataProvider.CustomQuery(typeof(BenQGuru.eMES.Domain.BaseSetting.StepSequence),
                                                           new SQLParamCondition(@"select distinct bigsscode from tblss where 1=1 " + GlobalVariables.CurrentOrganizations.GetSQLCondition() + @" and bigsscode=$BIGSSCODE",
                                                                                 new SQLParameter[] { new SQLParameter("$BIGSSCODE", typeof(string), bigSSCode.ToUpper()) }));

                if (objss == null)
                {
                    if (!checkedRow.ContainsKey(bigSSCode))
                    {
                        checkedRow.Add(bigSSCode, false);
                    }

                    gridRow.Items.FindItemByKey(gridHelper.CheckColumnKey).Value = false;
                    gridRow.Items.FindItemByKey("ImportResult").Text             = _LanguageComponent1.GetString("$BIGSSCODE_IS_NOT_EXIT");
                    gridRow.Items.FindItemByKey("ImportResult").CssClass         = "MsgYellow";
                    this._ImportDataTable.Rows.Remove(row);
                    this._ImportGridRow.Remove(gridRow);

                    continue;
                }

                if (_MaterialFacade == null)
                {
                    _MaterialFacade = new MaterialFacade(_DataProvider);
                }

                object objWorkPlanFromDB = _MaterialFacade.GetWorkPlan(bigSSCode, int.Parse(planDate), moCode, decimal.Parse(moSeq));

                if (objWorkPlanFromDB != null)
                {
                    //修改的投入数量必须大于等于实际数量
                    if (decimal.Parse(planQty) < ((WorkPlan)objWorkPlanFromDB).ActQty)
                    {
                        if (!checkedRow.ContainsKey(planQty))
                        {
                            checkedRow.Add(planQty, false);
                        }

                        gridRow.Items.FindItemByKey(gridHelper.CheckColumnKey).Value = false;
                        gridRow.Items.FindItemByKey("ImportResult").Text             = _LanguageComponent1.GetString("$planqty_isnotequ_actqty");
                        gridRow.Items.FindItemByKey("ImportResult").CssClass         = "MsgYellow";
                        this._ImportDataTable.Rows.Remove(row);
                        this._ImportGridRow.Remove(gridRow);

                        continue;
                    }

                    if ((((WorkPlan)objWorkPlanFromDB).ActionStatus == WorkPlanActionStatus.WorkPlanActionStatus_Close))
                    //执行状态为待投产或生产中才update
                    {
                        if (!checkedRow.ContainsKey(planDate))
                        {
                            checkedRow.Add(planDate, false);
                        }

                        gridRow.Items.FindItemByKey(gridHelper.CheckColumnKey).Value = false;
                        gridRow.Items.FindItemByKey("ImportResult").Text             = _LanguageComponent1.GetString("$status_error");
                        gridRow.Items.FindItemByKey("ImportResult").CssClass         = "MsgYellow";
                        this._ImportDataTable.Rows.Remove(row);
                        this._ImportGridRow.Remove(gridRow);

                        continue;
                    }
                }

                if (int.Parse(planDate) < shiftDay)
                {
                    if (!checkedRow.ContainsKey(planDate))
                    {
                        checkedRow.Add(planDate, false);
                    }

                    gridRow.Items.FindItemByKey(gridHelper.CheckColumnKey).Value = false;
                    gridRow.Items.FindItemByKey("ImportResult").Text             = "计划日期不能早于当前日期";
                    gridRow.Items.FindItemByKey("ImportResult").CssClass         = "MsgYellow";
                    this._ImportDataTable.Rows.Remove(row);
                    this._ImportGridRow.Remove(gridRow);

                    continue;
                }

                WorkPlan GetworkPlanByKeys    = (WorkPlan)materialFacade.GetWorkPlan(bigSSCode, int.Parse(planDate), moCode, decimal.Parse(moSeq));
                WorkPlan GetworkPlanByUniques = (WorkPlan)materialFacade.GetWorkPlan(bigSSCode, int.Parse(planDate), int.Parse(planSeq));

                if (GetworkPlanByKeys == null && GetworkPlanByUniques != null)
                {
                    if (!checkedRow.ContainsKey(moCode))
                    {
                        checkedRow.Add(moCode, false);
                    }

                    gridRow.Items.FindItemByKey(gridHelper.CheckColumnKey).Value = false;
                    gridRow.Items.FindItemByKey("ImportResult").Text             = "请检查日期+线别+投产顺序的唯一性";
                    gridRow.Items.FindItemByKey("ImportResult").CssClass         = "MsgYellow";
                    this._ImportDataTable.Rows.Remove(row);
                    this._ImportGridRow.Remove(gridRow);

                    continue;
                }

                if (GetworkPlanByKeys != null && GetworkPlanByUniques != null)
                {
                    if (GetworkPlanByKeys.BigSSCode != GetworkPlanByUniques.BigSSCode ||
                        GetworkPlanByKeys.PlanDate != GetworkPlanByUniques.PlanDate ||
                        GetworkPlanByKeys.MoCode != GetworkPlanByUniques.MoCode ||
                        GetworkPlanByKeys.MoSeq != GetworkPlanByUniques.MoSeq)
                    {
                        if (!checkedRow.ContainsKey(moCode))
                        {
                            checkedRow.Add(moCode, false);
                        }

                        gridRow.Items.FindItemByKey(gridHelper.CheckColumnKey).Value = false;
                        gridRow.Items.FindItemByKey("ImportResult").Text             = "请检查日期+线别+投产顺序的唯一性";
                        gridRow.Items.FindItemByKey("ImportResult").CssClass         = "MsgYellow";
                        this._ImportDataTable.Rows.Remove(row);
                        this._ImportGridRow.Remove(gridRow);

                        continue;
                    }
                }

                if (!checkedRow.ContainsKey(moCode))
                {
                    checkedRow.Add(moCode, false);
                }

                gridRow.Items.FindItemByKey(gridHelper.CheckColumnKey).Value = true;
            }
        }
Пример #6
0
 private void InitItemType()
 {
     this.ddlItemType.Items.Clear();
     this.ddlItemType.Items.Add(new ListItem(_LanguageComponent1.GetString(ItemType.ITEMTYPE_FINISHEDPRODUCT), ItemType.ITEMTYPE_FINISHEDPRODUCT));
     this.ddlItemType.Items.Add(new ListItem(_LanguageComponent1.GetString(ItemType.ITEMTYPE_SEMIMANUFACTURE), ItemType.ITEMTYPE_SEMIMANUFACTURE));
 }
Пример #7
0
        /// <summary>
        ///
        /// </summary>
        /// <param name="isRollBack">true:出错就回滚;false:出错skip到下一个</param>
        public void Import(bool isRollBack)
        {
            ShiftModelFacade shiftModelFacade = new ShiftModelFacade(this._dataProvider);
            DBDateTime       dbDateTime       = FormatHelper.GetNowDBDateTime(this._dataProvider);

            object[] objDt = null;
            if (string.Compare(ImportType, "IndirectManCount", true) == 0)
            {
                objDt = ConvertArrayListToObjectArray(ImportDatatable, "IndirectManCount");
            }

            if (string.Compare(ImportType, "Line2Crew", true) == 0)
            {
                objDt = ConvertArrayListToObjectArray(ImportDatatable, "Line2Crew");
            }

            try
            {
                _dataProvider.BeginTransaction();

                if (string.Compare(ImportType, "IndirectManCount", true) == 0)
                {
                    if (objDt != null)
                    {
                        for (int i = 0; i < objDt.Length; i++)
                        {
                            try
                            {
                                GridRecord       row = ImportGridRow[i] as GridRecord;
                                IndirectManCount IndirectManCountExcel = objDt[i] as IndirectManCount;

                                if (_Facade == null)
                                {
                                    _Facade = new PerformanceFacade(_dataProvider);
                                }

                                IndirectManCount getWorkPlanFromDB = (IndirectManCount)_Facade.GetIndirectManCount(IndirectManCountExcel.ShiftDate,
                                                                                                                   IndirectManCountExcel.ShiftCode,
                                                                                                                   IndirectManCountExcel.CrewCode,
                                                                                                                   IndirectManCountExcel.FactoryCode,
                                                                                                                   IndirectManCountExcel.FirstClass);

                                if (getWorkPlanFromDB != null)
                                {
                                    ((IndirectManCount)objDt[i]).FactoryCode = IndirectManCountExcel.FactoryCode;
                                    ((IndirectManCount)objDt[i]).FirstClass  = IndirectManCountExcel.FirstClass;

                                    _dataProvider.Update(objDt[i]);
                                    row.Items.FindItemByKey("ImportResult").Text     = _languageComponent1.GetString("$CycleImport_Success");
                                    row.Items.FindItemByKey("ImportResult").CssClass = "LinkColorBlue";
                                }
                                else
                                {
                                    _dataProvider.Insert(objDt[i]);
                                    row.Items.FindItemByKey("ImportResult").Text     = _languageComponent1.GetString("$CycleImport_Success");
                                    row.Items.FindItemByKey("ImportResult").CssClass = "LinkColorBlue";
                                }
                            }
                            catch (Exception ex)
                            {
                                GridRecord row = ImportGridRow[i] as GridRecord;
                                row.Items.FindItemByKey("ImportResult").Text     = _languageComponent1.GetString("$CycleImport_Error");
                                row.Items.FindItemByKey("ImportResult").CssClass = "ForeColorRed";
                                this.ErrorArray.Add(ex);
                            }
                        }
                    }
                }

                if (string.Compare(ImportType, "Line2Crew", true) == 0)
                {
                    if (objDt != null)
                    {
                        for (int i = 0; i < objDt.Length; i++)
                        {
                            try
                            {
                                GridRecord row            = ImportGridRow[i] as GridRecord;
                                Line2Crew  Line2CrewExcel = objDt[i] as Line2Crew;

                                if (_Facade == null)
                                {
                                    _Facade = new PerformanceFacade(_dataProvider);
                                }

                                Line2Crew getLine2CrewFromDB = (Line2Crew)_Facade.GetLine2Crew(Convert.ToInt32(Line2CrewExcel.ShiftDate), Line2CrewExcel.SSCode.ToString(), Line2CrewExcel.ShiftCode);

                                if (getLine2CrewFromDB != null)
                                {
                                    getLine2CrewFromDB.CrewCode = Line2CrewExcel.CrewCode;

                                    _dataProvider.Update(getLine2CrewFromDB);
                                    row.Items.FindItemByKey("ImportResult").Text     = _languageComponent1.GetString("$CycleImport_Success");
                                    row.Items.FindItemByKey("ImportResult").CssClass = "LinkColorBlue";
                                }
                                else
                                {
                                    _dataProvider.Insert(objDt[i]);
                                    row.Items.FindItemByKey("ImportResult").Text     = _languageComponent1.GetString("$CycleImport_Success");
                                    row.Items.FindItemByKey("ImportResult").CssClass = "LinkColorBlue";
                                }
                            }
                            catch (Exception ex)
                            {
                                GridRecord row = ImportGridRow[i] as GridRecord;
                                row.Items.FindItemByKey("ImportResult").Text     = _languageComponent1.GetString("$CycleImport_Error");
                                row.Items.FindItemByKey("ImportResult").CssClass = "ForeColorRed";
                                this.ErrorArray.Add(ex);
                            }
                        }
                    }
                }

                _dataProvider.CommitTransaction();
            }
            catch (Exception ex)
            {
                _dataProvider.RollbackTransaction();
                this.ErrorArray.Add(ex);
            }
        }
Пример #8
0
 private void ddlGoodSemiGoodWhere_Load(object sender, System.EventArgs e)
 {
     this.ddlGoodSemiGoodWhere.Items.Clear();
     this.ddlGoodSemiGoodWhere.Items.Add(new ListItem("", ""));
     this.ddlGoodSemiGoodWhere.Items.Add(new ListItem(_LanguageComponent.GetString(ItemType.ITEMTYPE_FINISHEDPRODUCT), ItemType.ITEMTYPE_FINISHEDPRODUCT));
     this.ddlGoodSemiGoodWhere.Items.Add(new ListItem(_LanguageComponent.GetString(ItemType.ITEMTYPE_SEMIMANUFACTURE), ItemType.ITEMTYPE_SEMIMANUFACTURE));
 }