Ejemplo n.º 1
0
 public IHttpActionResult Save(paramvalues_vm Record)
 {
     try
     {
         using (SysParamService obj = new SysParamService())
             return(Ok(obj.Save(Record)));
     }
     catch (Exception Ex)
     {
         return(ResponseMessage(Request.CreateErrorResponse(HttpStatusCode.BadRequest, Ex.Message.ToString())));
     }
 }
Ejemplo n.º 2
0
        public Dictionary <string, object> Save(paramvalues_vm Record)
        {
            Dictionary <string, object> RetData = new Dictionary <string, object>();

            try
            {
                Con_Oracle = new DBConnection();

                DBRecord Rec = new DBRecord();

                Con_Oracle.BeginTransaction();

                sql = "delete from paramvalues where parent_id ='" + Record.param_pkid + "'";
                Con_Oracle.ExecuteNonQuery(sql);

                foreach (paramvalues _Record in Record.RecordDet)
                {
                    if (_Record.param_value.ToString().Length > 0)
                    {
                        _Record.param_pkid = System.Guid.NewGuid().ToString().ToUpper();
                        Rec.CreateRow("paramvalues", "ADD", "param_pkid", _Record.param_pkid);
                        Rec.InsertString("parent_id", Record.param_pkid);
                        Rec.InsertString("param_key", _Record.param_key);
                        Rec.InsertString("param_value", _Record.param_value, "P");

                        Rec.InsertString("param_filetype", _Record.param_filetype);
                        Rec.InsertString("param_impexp", _Record.param_impexp);
                        Rec.InsertString("param_edifile", _Record.param_edifile);

                        Rec.InsertString("param_format", _Record.param_format);

                        Rec.InsertString("rec_company_code", Record._globalvariables.comp_code);
                        sql = Rec.UpdateRow();
                        Con_Oracle.ExecuteNonQuery(sql);
                    }
                }
                Con_Oracle.CommitTransaction();
                Con_Oracle.CloseConnection();
            }
            catch (Exception Ex)
            {
                if (Con_Oracle != null)
                {
                    Con_Oracle.RollbackTransaction();
                    Con_Oracle.CloseConnection();
                }
                throw Ex;
            }
            Con_Oracle.CloseConnection();
            return(RetData);
        }