コード例 #1
0
        public JsonResult PlanificacionIns(EPlanificacion entidadPlanificacion)
        {
            string xml = string.Empty;

            foreach (EPlanificacionSucursalAlmacen eps in entidadPlanificacion.ListaPlanificacionSucursalAlmacen)
            {
                if (eps.IdSucursalAlmacen == 0)
                {
                    return(Json(new ERespuesta {
                        Estado = 0, Mensaje = "Seleccionar el sucursal-almacén"
                    }));
                }
            }

            if (entidadPlanificacion.FechaInicioWithFormat == "01/01/0001")
            {
                return(Json(new ERespuesta {
                    Estado = 0, Mensaje = "Completar la fecha de ejecucion"
                }));
            }

            xml = ConvertToXML.Registrar_XML(entidadPlanificacion);

            ERespuesta objRespuesta = objPlanificacion.SIGESU_PlanificacionIns(xml);

            return(Json(objRespuesta));
        }
コード例 #2
0
        public JsonResult GrabarPropuesta(EPlanificacion entidadPlanificacion)
        {
            string           xml = string.Empty;
            List <EProducto> listaProductosPropuestos = new List <EProducto>();

            foreach (EPlanificacionSucursal eps in entidadPlanificacion.ListaPlanificacionSucursal)
            {
                if (eps.COD_SUCURSAL == null)
                {
                    return(Json(new Entidades.DTO_TP3.ERespuesta {
                        Estado = 0, Mensaje = "Seleccionar el sucursal"
                    }));
                }
            }

            if (entidadPlanificacion.FechaInicioWithFormat == "01/01/0001")
            {
                return(Json(new ERespuesta {
                    Estado = 0, Mensaje = "Completar la fecha inicio de ejecucion"
                }));
            }

            if (entidadPlanificacion.FechaFinWithFormat == "01/01/0001")
            {
                return(Json(new ERespuesta {
                    Estado = 0, Mensaje = "Completar la fecha fin de ejecucion"
                }));
            }

            //Obtener lista de productos propuestos.
            //En base a estas listas, se crearán dos tipos de planificaciones: Laboratorio y Campo

            listaProductosPropuestos = objProducto.GCPS_SP_ProductoEnPlanificacionSel();

            //PLANIFICACION TIPO LABORATORIO
            entidadPlanificacion.TipoPlanificacion = Constantes.TipoPlanificacion.LABORATORIO;
            entidadPlanificacion.detalleProductos  = listaProductosPropuestos.Where(x => x.TIPOPLAN.Equals(Constantes.TipoPlanificacion.LABORATORIO)).ToList();

            xml = ConvertToXML.Registrar_XML(entidadPlanificacion);

            objPlanificacion.GCPS_SP_PlanificacionIns(xml);


            //PLANIFICACION TIPO CAMPO
            entidadPlanificacion.TipoPlanificacion = Constantes.TipoPlanificacion.CAMPO;
            entidadPlanificacion.detalleProductos  = listaProductosPropuestos.Where(x => x.TIPOPLAN.Equals(Constantes.TipoPlanificacion.CAMPO)).ToList();;

            xml = ConvertToXML.Registrar_XML(entidadPlanificacion);

            ERespuesta objRespuesta = objPlanificacion.GCPS_SP_PlanificacionIns(xml);

            return(Json(objRespuesta));
        }
コード例 #3
0
        //Add By Tany 2016-04-13
        /// <summary>
        ///  检查病人老系统是否结算,如果老系统结算新系统未结算,则同步调用结算方法
        /// </summary>
        /// <param name="zyh">住院号</param>
        /// <param name="db">新系统数据库连接</param>
        public static void CheckPatJszt(string zyh, RelationalDatabase db)
        {
            try
            {
                InstanceOldHISDb();

                bool iscyjs = false;

                string    sql = "select * from yw_zybrzh where zyh='" + Convert.ToInt64(zyh) + "'";
                DataTable tb  = InFomixDb.GetDataTable(sql);
                if (tb != null && tb.Rows.Count > 0)
                {
                    if (Convertor.IsNull(tb.Rows[0]["bz"], "").ToUpper() == "Y")
                    {
                        iscyjs = true;
                    }
                }
                if (!iscyjs)
                {
                    MessageBox.Show("住院号【" + zyh + "】的病人在老系统还未结算!");
                    return;
                }
                else
                {
                    sql = "select * from vi_zy_vinpatient_all where convert(bigint,inpatient_no)='" + Convert.ToInt64(zyh) + "'";
                    tb  = db.GetDataTable(sql);
                    if (tb == null || tb.Rows.Count == 0)
                    {
                        MessageBox.Show("住院号【" + zyh + "】的病人在新系统未找到信息!");
                        return;
                    }
                    int flag = Convert.ToInt32(tb.Rows[0]["flag"]);
                    if (flag == 2 || flag == 6)
                    {
                        MessageBox.Show("住院号【" + zyh + "】的病人在新系统已经结算!");
                        return;
                    }
                    else
                    {
                        //调用WS同步结算状态
                        string xml = "";
                        sql = "select zyh,id as patientid,xm,zt as jszt,jsdjh,cyrq,ryrq as ksrq,jsrq,0 as yjj,zfy as ylzfy,gfje as ybzf,zfje,djrq,czy as djybm from v_brfy where zyh='" + Convert.ToInt64(zyh) + "'";
                        tb  = InFomixDb.GetDataTable(sql);
                        if (tb != null && tb.Rows.Count > 0)
                        {
                            xml = ConvertToXML.DataTableToXmlEx(tb, "message");
                            TrasenWS.TrasenWS ws     = new TrasenHIS.TrasenWS.TrasenWS();
                            string            strXML = "";
                            strXML = ws.ExeWebService("SaveCyzt", xml);
                            DataSet dset = HisFunctions.ConvertXmlToDataSet(strXML);
                            if (dset.Tables["HEAD"].Rows.Count > 0)
                            {
                                if (dset.Tables["HEAD"].Rows[0]["ERRCODE"].ToString() == "-1")
                                {
                                    throw new Exception("调用WS出院结算时出现错误:" + dset.Tables["HEAD"].Rows[0]["ERRTEXT"].ToString());
                                }
                            }
                            MessageBox.Show("同步结算状态成功,请继续您的操作!");
                        }
                    }
                }
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message);
            }
        }