/// <summary>
        /// Delete material
        /// </summary>
        /// <param name="material"></param>
        /// <returns></returns>
        public bool DelMaterial(QCMaterial material)
        {
            Console.WriteLine("MaterialDAL-DelMaterial():" + DateTime.Now.ToString());
            try
            {
                string msg = gate.DbHelper.ExecuteStoredProcedure("I_CheckDeleteMaterial",
                                                                  new string[] { "SampleName", "LOT_NO" },
                                                                  new object[] { material.SampleName, material.LOT_NO }).Tables[0].Rows[0][0].ToString();


                if (string.IsNullOrEmpty(msg))
                {
                    return(db.Delete(GetMaterial(material.SampleName, material.LOT_NO)));
                }
                else
                {
                    throw new Exception(msg);
                }
            }
            catch (Exception ex)
            {
                log.Error(ex);

                throw new Exception(ex.Message);
            }
        }
        private void _MT01View_eventShowDetails(object sender, EventArgs e)
        {
            EgateArgs args = (EgateArgs)e;

            if (string.IsNullOrEmpty((string)args.EgateDictionary["LOT_NO"].ToString()))
            {
                WriteTips(5, "No Material selected");
            }
            else
            {
                QCMaterial s = new QCMaterial
                {
                    SampleName     = args.EgateDictionary["SampleName"].ToString(),
                    LOT_NO         = args.EgateDictionary["LOT_NO"].ToString(),
                    Description_EN = args.EgateDictionary["Description_EN"].ToString(),
                    Description_TW = args.EgateDictionary["Description_TW"].ToString(),
                    Description_CN = args.EgateDictionary["Description_CN"].ToString(),
                    Description_VN = args.EgateDictionary["Description_VN"].ToString(),
                    IsGrade        = Convert.ToBoolean(args.EgateDictionary["IsGrade"])
                };

                _MT01Dialog.Material = s;

                if (_MT01Dialog.ShowDialog() == DialogResult.OK)
                {
                    Query();
                    WriteTips(5, "Save Successful!");
                }
            }
        }
        /// <summary>
        /// Modify Material
        /// </summary>
        /// <param name="material"></param>
        /// <returns></returns>
        public bool UpdateMaterial(QCMaterial material)
        {
            Console.WriteLine("MaterialDAL-UpdateMaterial():" + DateTime.Now.ToString());
            try
            {
                return(db.Update(material));
            }
            catch (Exception e)
            {
                log.Error(e);

                throw new Exception(e.Message);
            }
        }
        public IHttpActionResult GradesProcessing(string id)
        {
            try
            {
                JsonObject       json  = new JsonObject();
                GradeMaterial    gra   = biz.GetGradeMaterial(id);
                GradeMaterialDto grade = new GradeMaterialDto();
                if (!string.IsNullOrEmpty(gra.SampleName) && !string.IsNullOrEmpty(gra.LOT_NO))
                {
                    SampleService sampleDal = new SampleService();
                    QCSample      sample    = sampleDal.SelectSample(gra.SampleName);

                    QCMaterial material = sampleDal.GetMaterial(gra.SampleName, gra.LOT_NO);
                    json["SampleName"]           = sample.SampleName;
                    json["SampleDescription_EN"] = sample.Description_EN;
                    json["SampleDescription_CN"] = sample.Description_CN;
                    json["SampleDescription_TW"] = sample.Description_TW;
                    json["SampleDescription_VN"] = sample.Description_VN;
                    json["Status"] = gra.Status;
                    json["Grade"]  = gra.Grades;
                    json["LOT_NO"] = material.LOT_NO;
                    json["MaterialDescription_EN"] = material.Description_EN;
                    json["MaterialDescription_CN"] = material.Description_CN;
                    json["MaterialDescription_TW"] = material.Description_TW;
                    json["MaterialDescription_VN"] = material.Description_VN;
                    json["Version"]    = gra.Version;
                    json["VersionSpc"] = gra.VersionSpc;
                    json["UserID"]     = gra.UserID;
                    //json["Remark"] = gra.Remark;
                    DataTable dtGrade = biz.NewestGrades(id);
                    json["Grades"] = helpbiz.ConvertJson(dtGrade);
                    return(Ok(json));
                }
                else
                {
                    return(BadRequest("NO DATA"));
                }
            }
            catch (Exception ex)
            {
                Console.WriteLine(ex);
                Loger.Error(ex);
                return(BadRequest(ex.Message + ex.StackTrace));
            }
        }
Beispiel #5
0
 public bool DeleteMaterial(QCMaterial Material)
 {
     return(proxy.DeleleMaterial(Material));
 }
Beispiel #6
0
 public bool UpdateMaterial(QCMaterial Material)
 {
     return(proxy.UpdateMaterial(Material));
 }
Beispiel #7
0
 public bool CreateMaterial(QCMaterial Material)
 {
     return(proxy.CreateMaterial(Material));
 }
 public bool DeleleMaterial(QCMaterial material)
 {
     return(materalDal.DelMaterial(material));
 }
 public bool UpdateMaterial(QCMaterial material)
 {
     return(materalDal.UpdateMaterial(material));
 }
 public bool CreateMaterial(QCMaterial material)
 {
     return(materalDal.CreateMaterial(material));
 }