示例#1
0
    /// <summary>
    ///  save IPQC_Ra_Head data
    /// </summary>
    /// <param name="rowid"> guid </param>
    /// <param name="action"> CRUD(Create、Read、Update、Delete) </param>
    /// <returns></returns>
    public bool save(string rowid, string action)
    {
        bool   isPass = true;
        string msg    = "";



        if (string.IsNullOrEmpty(_tooling))
        {
            msg   += "Tooling No ";
            isPass = false;
        }

        if (string.IsNullOrEmpty(_test_item))
        {
            msg   += "Test Item ";
            isPass = false;
        }

        if (string.IsNullOrEmpty(_test_type))
        {
            msg   += "Test Type ";
            isPass = false;
        }

        if (string.IsNullOrEmpty(_product))
        {
            msg   += "Product Type ";
            isPass = false;
        }

        if (string.IsNullOrEmpty(_material))
        {
            msg   += "Material ";
            isPass = false;
        }

        if (string.IsNullOrEmpty(_program))
        {
            msg   += "Program Name ";
            isPass = false;
        }

        if (_sample <= 0)
        {
            msg   += "Sample Quantity ";
            isPass = false;
        }



        if (isPass == true)
        {
            IPQC_Ra_Head head = new IPQC_Ra_Head();
            if (action == "c")
            {
                head.Insert(rowid, _product, _program, _equipment, _tooling, _test_type, _test_item, _deptNo, _bomDt, _receivedDt, _material, _sample, _remark, _dispatch, "um", CurrentUser.ID);
            }

            if (action == "u")
            {
                head.Update(rowid, _product, _program, _equipment, _tooling, _test_type, _test_item, _bomDt, _material, _sample, _remark);
            }
        }
        return(isPass);
    }
示例#2
0
    private bool save(string rowid)
    {
        bool   isPass = true;
        string msg    = "";

        if (string.IsNullOrEmpty(_dispatch))
        {
            msg    = "Dispatch No ";
            isPass = false;
        }

        if (string.IsNullOrEmpty(_tooling))
        {
            msg   += "Tooling No ";
            isPass = false;
        }

        if (string.IsNullOrEmpty(_test_item))
        {
            msg   += "Test Item ";
            isPass = false;
        }

        if (string.IsNullOrEmpty(_test_type))
        {
            msg   += "Test Type ";
            isPass = false;
        }

        if (string.IsNullOrEmpty(_product))
        {
            msg   += "Product Type ";
            isPass = false;
        }

        if (string.IsNullOrEmpty(_material))
        {
            msg   += "Material ";
            isPass = false;
        }

        if (string.IsNullOrEmpty(_program))
        {
            msg   += "Program Name ";
            isPass = false;
        }

        if (_sample <= 0)
        {
            msg   += "Sample Quantity ";
            isPass = false;
        }
        if (string.IsNullOrEmpty(_equipment))
        {
            msg   += "Manufacturing Equipment ";
            isPass = false;
        }


        if (isPass == true)
        {
            IPQC_Ra_Head head = new IPQC_Ra_Head();
            head.Insert(rowid, _product, _program, _equipment, _tooling, _test_type, _test_item, _deptNo, _bomDt, _receivedDt, _material, _sample, _remark, _dispatch, "um", CurrentUser.ID);
        }
        else
        {
            string show = "please these item: " + msg;
            ClientScript.RegisterStartupScript(this.GetType(), "", "wrong('" + show + "')", true);
        }

        return(isPass);
    }