Beispiel #1
0
    protected void btnDelete_ServerClick(Object sender, EventArgs e)
    {

        //string familyId = this.dFamily.Text.Trim();
        string oldId = this.dOldId.Value.Trim();
        try
        {
            QCRatioDef item = new QCRatioDef();
            item.Family = oldId;
            iQCRatio.DeleteQCRatio(item);
        }
        catch (FisException ex)
        {
            showErrorMessage(ex.mErrmsg);
            return;
        }
        catch (Exception ex)
        {
            //show error
            showErrorMessage(ex.Message);
            return;
        }
        ShowListByCustom();
        this.updatePanel2.Update();
        ScriptManager.RegisterStartupScript(this.updatePanelAll, typeof(System.Object), "saveUpdate", "DeleteComplete();DealHideWait();", true);


    }
Beispiel #2
0
        //若Family为空,则将当前Customer保存到记录中的Family栏位


        //GetExistQCRatio(String customer, string QCRatioId)

        //SELECT [IMES_FA].[dbo].[QCRatio].[Family]
        //  FROM [IMES_FA].[dbo].[QCRatio] inner join 
        //[IMES_GetData].[dbo].[Family] on [IMES_FA].[dbo].[QCRatio].[Family]=[IMES_GetData].[dbo].[Family].[Family]
        //WHERE [IMES_GetData].[dbo].[Family].[CustomerID]='customer' 
        //AND [IMES_FA].[dbo].[QCRatio].[Family]='QCRatioId'

        //change to:
        //     SELECT [IMES_FA_Datamaintain].[dbo].[QCRatio].[Family]
        //          FROM [IMES_FA_Datamaintain].[dbo].[QCRatio] inner join
        //    (select [IMES_GetData_Datamaintain].[dbo].[Family].Family from [IMES_GetData_Datamaintain].[dbo].[Family]
        //        WHERE [IMES_GetData_Datamaintain].[dbo].[Family].[CustomerID]='customer' union 
        //        select [IMES_GetData_Datamaintain].dbo.Customer.Customer AS [Family] from [IMES_GetData_Datamaintain].dbo.Customer
        //        WHERE [IMES_GetData_Datamaintain].dbo.Customer.Customer='customer'
        //        ) AS C
        //on [IMES_FA_Datamaintain].[dbo].[QCRatio].[Family]=C.[Family]
        //        WHERE [IMES_FA_Datamaintain].[dbo].[QCRatio].[Family]='QCRatioId'
        //change to:
        //SELECT [Family]      
        //  FROM [QCRatio]
        //WHERE [QCRatio].[Family]=@ QCRatioFamily

        public string AddQCRatio(QCRatioDef item)
        {
            String result = "";
            try
            {
                IFamilyRepository itemRepository = RepositoryFactory.GetInstance().GetRepository<IFamilyRepository>();

                DataTable exists=itemRepository.GetExistQCRatio(item.Family);
                if (exists != null && exists.Rows.Count > 0)
                {
                    //已经存在具有相同Customer和Family的QCRatio记录
                    List<string> erpara = new List<string>();
                    FisException ex;
                    ex = new FisException("DMT007", erpara);
                    throw ex;

                }
                int intQCRatio;
                int intEOQCRatio;
                int intPAQCRatio;
                int intRPAQCRatio;

                if (item.QCRatio == "")
                {
                    intQCRatio = Int32.MinValue;
                }
                else
                {
                    intQCRatio = Int32.Parse(item.QCRatio);
                }

                if (item.EOQCRatio == "")
                {
                    intEOQCRatio = Int32.MinValue;
                }
                else
                {
                    intEOQCRatio = Int32.Parse(item.EOQCRatio);
                }

                if (item.PAQCRatio  == "")
                {
                    intPAQCRatio = Int32.MinValue;
                }
                else
                {
                    intPAQCRatio = Int32.Parse(item.PAQCRatio);
                }
                if (item.RPAQCRatio == "")
                {
                    intRPAQCRatio = Int32.MinValue;
                }
                else
                {
                    intRPAQCRatio = Int32.Parse(item.RPAQCRatio);
                }

                QCRatio itemQCRatio=new QCRatio(
                    item.Family,
                    intQCRatio,
                    intEOQCRatio,
                    intPAQCRatio,
                    item.Editor,
                    DateTime.Now,
                    DateTime.Now,
                    intRPAQCRatio
                    );             
                
                itemRepository.AddQCRatio(itemQCRatio);
                result = itemQCRatio.Family;
            }
            catch (Exception)
            {
                throw;
            }

            return result;
        }
Beispiel #3
0
    protected void btnAdd_ServerClick(Object sender, EventArgs e)
    {
        QCRatioDef item = new QCRatioDef();
        String itemId;

        String model = this.cmbMaintainModelByFamily.InnerDropDownList.SelectedValue;
        if (model != "")
        {
            item.Family = model;
        }
        else
        {
            item.Family = this.cmbMaintainFamily.InnerDropDownList.SelectedValue;
        }

        item.QCRatio = this.dQCRatio.Text.Trim();
        item.EOQCRatio = this.dEQQCRatio.Text.Trim();
        item.PAQCRatio = this.dPAQCRatio.Text.Trim();
        item.RPAQCRatio = this.dRPAQCRatio.Text.Trim();
        item.Customer = this.cmbCustomer.InnerDropDownList.SelectedValue;
        item.Editor = this.HiddenUserName.Value; 

        try
        {
            itemId=iQCRatio.AddQCRatio(item);
        }
        catch (FisException ex)
        {
            showErrorMessage(ex.mErrmsg);
            return;
        }
        catch (Exception ex)
        {
            //show error
            showErrorMessage(ex.Message);
            return;
        }
        ShowListByCustom();
        itemId = replaceSpecialChart(itemId);
        this.updatePanel2.Update();
        ScriptManager.RegisterStartupScript(this.updatePanelAll, typeof(System.Object), "saveUpdate", "AddUpdateComplete('" + itemId + "');DealHideWait();", true);

    }
Beispiel #4
0
        public void DeleteQCRatio(QCRatioDef item)
        {
            try
            {
                IFamilyRepository itemRepository = RepositoryFactory.GetInstance().GetRepository<IFamilyRepository>();
                QCRatio itemQCRatio = new QCRatio(
                    item.Family,
                    0,
                    0,
                    0,
                    "",
                    DateTime.Now,
                    DateTime.Now,
                    0);

                itemRepository.DeleteQCRatio(itemQCRatio);
            }
            catch (Exception)
            {
                throw;
            }
        }