Exemplo n.º 1
0
    protected void Y_PictureBind(object sender, Ext.Net.StoreRefreshDataEventArgs e)
    {
        lbinfo.Text = "";
        try
        {
            if (TxtStyleId.Text.Trim().Length <= 0)
                return;
            string sql = "SELECT DISTINCT F.StyleId,F.ColorId,BrName,S_Name,St_Year,St_Month,St_Xl,St_Xz,St_Dl,P.Picture FROM dbo.Y_StyleFoundation F LEFT JOIN dbo.Y_StylePicture P ON F.StyleId=P.StyleId AND F.ColorId=P.ColorId WHERE F.StyleId='{0}'";
            sql = string.Format(sql, TxtStyleId.Text.Trim().Replace("'", "").Replace("-", ""));
            DataTable dt = DBHelper.WMSFactory.Y_StylePicture.Query(sql);
            if (dt.Rows.Count <= 0)
            {
                lbinfo.Text = "没有任何记录,请检查款号是否正确!";
                return;
            }

            Y_MainStore.DataSource = dt;
            Y_MainStore.DataBind();

        }
        catch (Exception error)
        {
            this.lbinfo.Text = "异常:" + error.Message;
        }
    }
        public void GuardaFechaPagoACoop(object sender, Ext.Net.DirectEventArgs e)
        {
            wsReportes.Error error;
            wsReportes.wsReportePrybe reportes = new wsReportes.wsReportePrybe();

            error = reportes.ActualizaSeguimiento(9, Convert.ToString(Session["IDEMISION"]), txtFechaPagoCoop.Text, txtNoOperFPC.Text);

            if (error.Value == false)
            {
                X.Msg.Show(new MessageBoxConfig
                {
                    Title = "Operación Registrada",
                    Message = "La operación fue registrada exitosamente.",
                    Buttons = MessageBox.Button.OK,
                    Icon = MessageBox.Icon.INFO
                });
                gridSeguimientoEmisiones.RefreshView();
            }
            else
            {
                X.Msg.Show(new MessageBoxConfig
                {
                    Title = "Advertencia!",
                    Message = "Ha ocurrido un problema: " + error.Msg,
                    Buttons = MessageBox.Button.OK,
                    Icon = MessageBox.Icon.WARNING
                });
            }

        }
Exemplo n.º 3
0
        public void UpdateDatos(object sender, Ext.Net.DirectEventArgs e)
        {
            string fechaIni = "";
            string fechaFin = "";

            switch (Convert.ToInt32(Session["FECHAS"]))
            {
                case 1:
                    fechaIni = "1980-01-01";
                    fechaFin = (DateTime.Today.ToString("yyyy-MM-dd"));
                    break;

                case 2:
                    fechaIni = Convert.ToDateTime(Session["DatePrybeIniSeg"]).ToString("yyyy-MM-dd");
                    fechaFin = Convert.ToDateTime(Session["DatePrybeFinSeg"]).ToString("yyyy-MM-dd");
                    break;

                case 3:
                    fechaIni = Convert.ToDateTime(Session["DatePrybeIniSeg"]).ToString("yyyy-MM-dd");
                    fechaFin = (DateTime.Today.ToString("yyyy-MM-dd"));
                    break;

                case 4:
                    fechaIni = "1980-01-01";
                    fechaFin = Convert.ToDateTime(Session["DatePrybeFinSeg"]).ToString("yyyy-MM-dd");
                    break;
            }
            wsReportes.wsReportePrybe reportes = new wsReportes.wsReportePrybe();
            List<wsReportes.Seguimiento> seguimientos = new List<wsReportes.Seguimiento>(reportes.ReporteSeguimiento(0, fechaIni, fechaFin));

            seguimientosSearch = seguimientos;
            this.storeSeguimiento.DataSource = seguimientos;
            this.storeSeguimiento.DataBind();
        }
 //查询
 protected void btnInquiry_DirectClick(object sender, Ext.Net.DirectEventArgs e)
 {
     DataTable dt = Bind();
     if (dt.Rows.Count == 0)
     {
         X.Msg.Alert("提示", "所查询部门没有数据,请添加数据").Show();
     }
 }
		protected override void AssertObjectsAreReadable(Ext.IExtObjectContainer objectContainer)
		{
			if (IsEmbeeded(objectContainer))
			{
				Assert.IsTrue(objectContainer.Ext().StoredClass(typeof(Item)).StoredField("Typed", typeof(Guid)).HasIndex());
			}
			base.AssertObjectsAreReadable(objectContainer);
		}
 protected void btnImport_DirectClick(object sender, Ext.Net.DirectEventArgs e)
 {
     if (FUFEXC.HasFile)
     {
         string connStr = ConfigurationManager.ConnectionStrings["ConChk"].ToString();
     }
     else
     {
         X.Msg.Alert("提示","请先选择!");
     }
 }
Exemplo n.º 7
0
 /*  ----------------------------------------------------------------------------------------
 *                  Controles de la ventana para enviar correos a PRYBE
 *   --------------------------------------------------------------------------------------*/
 /// <summary>
 /// Muestra ventana de contacto
 /// </summary>
 /// <param name="sender">object sende</param>
 /// <param name="e">Ext.Net.DirectEventArgs e</param>
 public void imgContacto_Click(object sender, Ext.Net.DirectEventArgs e)
 {
     wdContacto.Show();
     if (Session["NombreCompleto"] != null)
     {
         txtEjecutivo.Text = Convert.ToString(Session["NombreCompleto"]);
     }
     if (Session["CorreoEjecutivo"] != null)
     {
         txtDe.Text = Convert.ToString(Session["CorreoEjecutivo"]);
     }            
 }
Exemplo n.º 8
0
 /// <summary>
 /// Método geral para carregar DropDownList
 /// </summary>
 /// <param name="ddl">DropDownList passar por referência</param>
 /// <param name="lista">Array com dados para carregar na DropDownList</param>
 /// <param name="strDataValueField">campo do List que será o DataValueField da DropDownList</param>
 /// <param name="strDataTextField">campo do List que será o DataTextField da DropDownList</param>
 public static void CarregarSelectBox(ref Ext.Net.SelectBox ddl, Array lista, string strDataValueField, string strDataTextField)
 {
     if (lista.Length > 0)
     {
         var store = ddl.GetStore();
         store.DataSource = lista;
         ddl.ValueField = strDataValueField;
         ddl.DisplayField = strDataTextField;
         store.DataBind();
         ddl.Items.Insert(0, new Ext.Net.ListItem("(Selecione)"));
     }
 }
Exemplo n.º 9
0
 /// <summary>
 /// Funcion encargada de hacer la navegación hacia atras
 /// Asociada al boton PreviusPage
 /// </summary>
 /// <param name="sender">object sender</param>
 /// <param name="e">Ext.Net.DirectEventArgs e</param>
 protected void Regresa_DirectEvent(object sender, Ext.Net.DirectEventArgs e)
 {
     int n;
     n = listaPagAnterior.IndexOf(listaPagAnterior.Last());
     //  Verifica que n sea mayor que 0 para validar que hay elementos en la lista de navegación
     if (n > 0)
     {
         //  Toma la dirección de la pagina previa, 
         //  la borra de la lista y pasa a dicha pagina
         pagAnt = listaPagAnterior.ElementAt(n - 1);
         listaPagAnterior.RemoveAt(n - 1);
         listaPagAnterior.Remove(listaPagAnterior.Last());
         Response.Redirect(pagAnt.uri);
     }
 }
Exemplo n.º 10
0
        public static Ext.Net.RecordFieldType GetFieldType(Ext.Net.ColumnBase column)
        {
            string columnType = column.GetType().Name;

            switch (columnType)
            {
                case "DateColumn":
                    return Ext.Net.RecordFieldType.Date;
                case "NumberColumn":
                    return Ext.Net.RecordFieldType.Float;
                case "CheckColumn":
                    return Ext.Net.RecordFieldType.Boolean;
                default:
                    return Ext.Net.RecordFieldType.Auto;
            }
        }
 protected void btnMod_DirectClick(object sender, Ext.Net.DirectEventArgs e)
 {
     DataTable dt = BG_PolicyLogic.GetUniformRulesDT();
     string idStr = dt.Rows[0]["PLID"].ToString();
     int PLID = Convert.ToInt32(idStr);
     string str = HEdit.Text;
     BG_Policy bg_Policy = BG_PolicyManager.GetBG_PolicyByPLID(PLID);
     bg_Policy.PContent = str;
     //KJEditor.Html = str;
     bg_Policy.PTime = DateTime.Now;
     //消息提示
     BG_PolicyManager.ModifyBG_Policy(bg_Policy);
     UniformRulesDataBind();
     X.Msg.Alert("提示", "修改成功").Show();
     Response.Redirect("PLUniformRules.aspx", true);
 }
Exemplo n.º 12
0
 public void Contacto_Envia(object sender, Ext.Net.DirectEventArgs e)
 {
     correoPrybe.wsCorreoPrybe correoEnvia = new correoPrybe.wsCorreoPrybe();
     string mensaje;
     //  Almacena nombre de variable del webconfig
     string correo;
     //  En base al tipo de contacto determina a quien se le enviara el correo
     tmpValue = Convert.ToInt32(cbMotivo.Value);
     switch (tmpValue)
     {
         case 1:
             correo = "correo8";
             break;
         case 2:
             correo = "correo8";
             break;
         case 3:
             correo = "correo8";
             break;
         case 4:
             correo = "correo8";
             break;
         case 5:
             correo = "correo8";
             break;
         default:
             correo = "correo8";
             break;
     }
     //  Si se tienen todos los datos necesarios se envia correo y se cacha mensaje
     if (txtDe.Text.Trim() != "" && txtAsunto.Text.Trim() != "" && txtContenido.Text.Trim() != "")
     {
         data.InsertTicket(Convert.ToInt32(Session["Ejecutivo"]), 1, txtAsunto.Text, txtContenido.Text, 1, "");
         mensaje = correoEnvia.EnviaCorreo(WebConfigurationManager.AppSettings.Get(correo), txtDe.Text, txtAsunto.Text, txtContenido.Text, true);
         Acceso.GeneraMensaje("Contacto", mensaje, 'I');//Mensaje de alerta
         Limpia_CamposCorreo();
         wdContacto.Hide();
         X.Get("maskDiv").AddClass("x-hide-display");//Oculta la máscara de bloqueo de pantalla
     }
     else
     {
         Acceso.GeneraMensaje("Introduzca los datos correctos",
                              "No introdujo todos los datos, verifique su contenido y vuelva a intentarlo", 'W');//Mensaje de alerta
         X.Get("maskDiv").AddClass("x-hide-display");//Oculta la máscara de bloqueo de pantalla
     }
 }
 protected void btnSearch_DirectClick(object sender, Ext.Net.DirectEventArgs e)
 {
     string StartYear = cboStartYear.RawValue.ToString();
     string StartMon = cboStartMon.RawValue.ToString();
     string EndYear = cboEndYear.RawValue.ToString();
     string EndMon = cboEndMon.RawValue.ToString();
     string startTime = StartYear + "-" + StartMon;
     string emdTime = EndYear + "-" + EndMon;
     if (Int32.Parse(StartYear) > Int32.Parse(EndYear))
     {
         return;
     }
     if (Int32.Parse(StartYear) == Int32.Parse(EndYear) && Int32.Parse(StartMon) > Int32.Parse(EndMon))
     {
         return;
     }
     Response.Redirect("OAAnnIncomAnaly.aspx?stime=" + startTime + "&etime=" + emdTime + "&hid1=" + hid1.Value + "&hid2=" + hid2.Value + "&hid3=" + hid3.Value, true);
 }
Exemplo n.º 14
0
        //  Evento para enviar el correo electronico
        public void Contacto_Envia(object sender, Ext.Net.DirectEventArgs e)
        {
            //correoPrybe.wsCorreoPrybe correoEnvia = new correoPrybe.wsCorreoPrybe();
            //string mensaje;
            ////  Almacena nombre de variable del webconfig
            //string correo;
            ////  En base al tipo de contacto determina a quien se le enviara el correo
            //tmpValue = Convert.ToInt32(cbMotivo.Value);
            //switch (tmpValue)
            //{
            //    case 1:
            //        correo = "correo1";
            //        break;
            //    case 2:
            //        correo = "correo1";
            //        break;
            //    case 3:
            //        correo = "correo1";
            //        break;
            //    case 4:
            //        correo = "correo1";
            //        break;
            //    case 5:
            //        correo = "correo1";
            //        break;
            //    default:
            //        correo = "correo1";
            //        break;
            //}
            ////  Si se tienen todos los datos necesarios se envia correo y se cacha mensaje
            //if (txtDe.Text.Trim() != "" && txtAsunto.Text.Trim() != "" && txtContenido.Text.Trim() != "")
            //{
            //    data.InsertTicket(Convert.ToInt32(Session["Ejecutivo"]), 1, txtAsunto.Text, txtContenido.Text, 1, "");
            //    mensaje = correoEnvia.EnviaCorreo(WebConfigurationManager.AppSettings.Get(correo), txtDe.Text, txtAsunto.Text, txtContenido.Text, true);
            //    GeneraMensaje("Contacto", mensaje, 'I');
            //    wdContacto.Close();

            //}
            //else //  En caso contrario se manda mensaje informando que faltan datos
            //{
            //    GeneraMensaje("Introduzca los datos correctos",
            //                     "No introdujo todos los datos, verifique su contenido y vuelva a intentarlo", 'W');
            //}
        }
Exemplo n.º 15
0
        protected void BindClassView(ITreeProvider provider, Guid parentID, Ext.Net.TreeNode parentNode, Guid selectedID)
        {
            List<ITreeNode> list = new List<ITreeNode>();
            if (!parentID.Equals(Guid.Empty) && parentNode == null)
            {
                ITreeNode entity = provider.GetTreeNode(parentID);
                if (entity == null) return;
                list.Add(entity);
            }
            else
            {
                list = provider.GetList(parentID, User.ID, Roles);
                //List<ITreeNode> list = provider.GetList(parentID);
            }
            foreach (ITreeNode item in list)
            {
                Ext.Net.TreeNode treeNode;
                treeNode = new Ext.Net.TreeNode(item.ID.ToString(), item.Name, Ext.Net.Icon.Folder);
                treeNode.Cls = "TreeNode-Default";
                if (parentNode != null) parentNode.Nodes.Add(treeNode);
                else (ClassView.Root[0] as Ext.Net.TreeNode).Nodes.Add(treeNode);

                if (item.ID == selectedID)
                {
                    //this.selectedNodeID = this.RequestClassificationTreeID;
                    //this.selectedNodeText = item.Name;
                    ClassView.SelectNode(treeNode.NodeID);
                    Ext.Net.TreeNodeBase tmpParent = treeNode.ParentNode;
                    while (tmpParent != null)
                    {
                        tmpParent.Expanded = true;
                        tmpParent = tmpParent.ParentNode;
                    }

                    //ClassView.SelectNode(treeNode.NodeID);
                    //ClassView.ExpandChildNodes(treeNode.NodeID);
                }
                this.BindClassView(provider, item.ID, treeNode, selectedID);
            }
        }
Exemplo n.º 16
0
    protected void btnSure_DirectClick(object sender, Ext.Net.DirectEventArgs e)
    {
        DataTable dt = BG_SysSettingManager.GetAllBG_SysSetting();
        int count = dt.Rows.Count;
        int curtime = 0;
        if (count == 0)
        {
            curtime = Convert.ToInt32(TFDefaultYear.Text);
        }
        else { curtime = Convert.ToInt32(dt.Rows[count - 1]["DefaultYear"].ToString()); }

        if (Convert.ToInt32(TFDefaultYear.Text.Trim()) >= curtime)
        {
            BG_SysSetting bg_sys = new BG_SysSetting();
            bg_sys.SysName = TFSysName.Text.Trim();
            bg_sys.DefaultYear = Convert.ToInt32(TFDefaultYear.Text.Trim());
            bg_sys.PepNum = Convert.ToInt32(TFPopNum.Text.Trim());
            BG_SysSettingManager.AddBG_SysSetting(bg_sys);
            X.Msg.Alert("提示", "添加成功!").Show();
        }
        else
        {
            BG_SysSetting bg_sys = new BG_SysSetting();
            bg_sys.SSID = Convert.ToInt32(hidID.Value);
            bg_sys.SysName = TFSysName.Text.Trim();
            bg_sys.DefaultYear = Convert.ToInt32(TFDefaultYear.Text.Trim());
            bg_sys.PepNum = Convert.ToInt32(TFPopNum.Text.Trim());
            bool flag = BG_SysSettingManager.ModifyBG_SysSetting(bg_sys);
            if (flag)
            {
                X.Msg.Alert("提示", "修改成功!").Show();
            }
            else
            {
                X.Msg.Alert("提示", "修改失败,请与管理员联系!").Show();
            }
        }
    }
Exemplo n.º 17
0
 public void BaseSave()
 {
     if (cbbplace.SelectedIndex == -1)
     {
         Ext.Msg.Alert("提示", "请选择地点!").Show();
         return;
     }
     if (TDID.Value.ToString() == "")
     {
         HBBLL hb = new HBBLL();
         hb.AddYPPTDetail(int.Parse(TID.Value.ToString()), int.Parse(cbbplace.SelectedItem.Value), hb.GetMaxMoveOrder(int.Parse(TID.Value.ToString())) + 1);
         cbbplace.Value = null;
         Ext.Msg.Alert("提示", "新增成功!").Show();
         Ext.DoScript("#{YPPTDetailStore}.reload();");
     }
     else
     {
         HBBLL hb = new HBBLL();
         hb.UpdateYPPTDetail(int.Parse(cbbplace.SelectedItem.Value), int.Parse(TDID.Value.ToString()));
         cbbplace.Value = null;
         Ext.Msg.Alert("提示", "修改成功!").Show();
         Ext.DoScript("#{YPPTDetailStore}.reload();");
     }
 }
Exemplo n.º 18
0
            public static int LaunchBuiltInApplication(Apps app, string task = "")
            {
                string enchanted = task;

                if (task == "" || task == " ") //check if there is a better task than empty.
                {
                    var def = Ext.GetDefaultTask(app);

                    if (def != null)
                    {
                        enchanted = def;
                    }
                }

                if (app < Apps.FeedbackDirect && app > Apps.Settings)
                {
                    //Description Attribute
                    return(LaunchApplication(GuidFromApp(app), enchanted));
                }
                else
                {
                    return(LaunchApplication(Ext.GetDescription(app), enchanted));
                }
            }
Exemplo n.º 19
0
 [AjaxMethod]//win 显示
 public void JoemInfo(string action)
 {
     if (action == "new")
     {
         Ext.DoScript("#{fpJoem}.getForm().reset();");
         hdnJoemid.SetValue("-1");
     }
     if (action == "addnew")
     {
         Ext.DoScript("#{fpJoem}.getForm().reset();");
         hdnJoemid.SetValue("-2");
     }
     if (action == "edit")
     {
         RowSelectionModel sm = gpJoem.SelectionModel.Primary as RowSelectionModel;
         if (sm.SelectedRows.Count > 0)
         {
             hdnJoemid.SetValue(sm.SelectedRow.RecordID);
             if (sm.SelectedRow.RecordID.Trim().Substring(0, 1) == "j")
             {
                 var joem = dc.ParJeomcriterion.First(p => p.Jcid == decimal.Parse(sm.SelectedRow.RecordID.Trim().Substring(1)));
                 tfJccontent.Text    = joem.Jccontent;
                 nfJoemMinscore.Text = joem.Minscore.ToString();
                 nfJoemMaxscore.Text = joem.Maxscore.ToString();
             }
             else
             {
                 var joem = dc.ParAddjeomcriterion.First(p => p.Ajcid == decimal.Parse(sm.SelectedRow.RecordID.Trim().Substring(1)));
                 tfJccontent.Text    = joem.Ajccontent;
                 nfJoemMinscore.Text = joem.Minscore.ToString();
                 nfJoemMaxscore.Text = joem.Maxscore.ToString();
             }
         }
     }
     JoemWindow.Show();
 }
Exemplo n.º 20
0
 GameObject NextTarget(GameObject current, float radius = 30)
 {
     Collider[] cols = Physics.OverlapSphere(transform.position, radius, LayerMask.GetMask("Enemies"), QueryTriggerInteraction.UseGlobal);
     if (cols.Length <= 0)
     {
         Destroy(gameObject);
         return(null);
     }
     for (int i = 0; i < cols.Length; i++)
     {
         Collider   col = cols[i];
         GameObject g   = col.gameObject;
         if (g != gameObject && g != current)
         {
             Debug.Log("FIX THE LINE OF SIGHT");
             if (true || Ext.LineOfSight(gameObject, g))
             {
                 return(g);
             }
         }
     }
     Destroy(gameObject);
     return(null);
 }
Exemplo n.º 21
0
 /// <summary>
 /// Verifica si se tiene el permiso necesario y si se tiene manda a formulario de analisis
 /// </summary>
 /// <param name="sender">object sender</param>
 /// <param name="e">Ext.Net.DirectEventArgs e</param>
 protected void Analisis_Click(object sender, Ext.Net.DirectEventArgs e)
 {
     if (Session["Permisos"] != null)
     {
         List<int> Permisos = new List<int>((int[])Session["Permisos"]);
         bool find;
         find = Permisos.Exists(delegate(int i) { return i == 152; });//i = ID Permiso a buscar
         if (find == false)
         {
             // Si no tiene el permiso manda niega acceso
             AccesoDenegado.GeneraMensaje("Faltan Permisos", "No tiene habilitados los permisos necesarios para poder entrar a esta pagina. " +
                 "Si requiere entrar a esta pagina, solicite al area de sistemas el acceso, con el formato correspondiente.", 'I');
             X.Get("maskDiv_Analisis").AddClass("x-hide-display");
         }
         else
         {
             Response.Redirect("AnalisisReclamo.aspx");
         }
     }
     else
     {
         Response.Redirect("/Login/Login.aspx");//Si Session["Permisos"] es null manda a loguin para cargar permisos
     }
 }
Exemplo n.º 22
0
        private Response SaveBigCourseInfo(CoachPrice coachPrice)
        {
            Response rsp = new Response();

            rsp.IsSuccess = true;
            List <EntityBase> entites = new List <EntityBase>();

            //先删除
            DeleteAllBigcourseInfo();
            foreach (var obj in coachPrice.BigCourseInfoList)
            {
                //后添加
                entites.Add(obj);

                obj.RowState     = RowState.Added;
                obj.CoachPriceId = coachPrice.Id;
                if (string.IsNullOrEmpty(obj.Id))
                {
                    //新纪录
                    obj.Id = Ext.NewId();
                }

                obj.CreateDate    = DateTime.Now;
                obj.CourseContent = CoachDic.CourseContent;
                obj.ModifyHeadIcon();
                obj.GetWillSaveFileList(entites);
            }

            rsp = DbContext.GetInstance().Execute(CommandHelper.CreateSave(entites));
            if (!rsp.IsSuccess)
            {
                return(rsp);
            }

            return(rsp);
        }
Exemplo n.º 23
0
 public void AddDept()
 {
     if (cbbDept.SelectedIndex == -1)
     {
         return;
     }
     if (SessionBox.GetUserSession().rolelevel.Contains("1") || SessionBox.GetUserSession().rolelevel.Contains("0"))
     {
         var dept = dc.Department.First(p => p.Deptnumber == cbbDept.SelectedItem.Value);
         if (dept.Visualfield == 3)
         {
             Ext.Msg.Alert("提示", "已添加的部门!").Show();
             return;
         }
         dept.Visualfield = 3;
         dc.SubmitChanges();
         Ext.Msg.Alert("提示", "保存成功!").Show();
         Ext.DoScript("refreshTree(#{tpkind});");
     }
     else
     {
         Ext.Msg.Alert("提示", "非局端用户,不能进行该项操作!").Show();
     }
 }
Exemplo n.º 24
0
        protected WebSocketServerBase(IPAddress address, int port, string absPath, bool secure)
        {
            if (address == null)
            {
                throw new ArgumentNullException("address");
            }

            if (absPath == null)
            {
                throw new ArgumentNullException("absPath");
            }

            string msg;

            if (!Ext.IsValidAbsolutePath(absPath, out msg))
            {
                throw new ArgumentException(msg, "absPath");
            }

            if ((port == 80 && secure) ||
                (port == 443 && !secure))
            {
                msg = String.Format(
                    "Invalid pair of 'port' and 'secure': {0}, {1}", port, secure);
                throw new ArgumentException(msg);
            }

            _address = address;
            _port    = port > 0
                      ? port
                      : secure ? 443 : 80;
            _uri      = Ext.ToUri(absPath);
            _isSecure = secure;

            init();
        }
Exemplo n.º 25
0
    protected void SearchBLDblClick(object sender, AjaxEventArgs e)
    {
        RowSelectionModel sm = gpSearchBL.SelectionModel.Primary as RowSelectionModel;

        if (sm.SelectedRows.Count > 0)
        {
            //修改多列显示
            var yh = from hd in dc.Gethazardusing
                     where hd.HNumber == sm.SelectedRow.RecordID && hd.Deptnumber == SessionBox.GetUserSession().DeptNumber
                     select new
            {
                yhNumber  = hd.HNumber,
                yhContent = hd.HBm,
                hd.Gzrwname,
                hd.Gxname
            };
            yhStore.DataSource = yh;
            yhStore.DataBind();
            cbbyh.SelectedItem.Value = sm.SelectedRow.RecordID;
            SearchBLWindow.Hide();
            Ext.DoScript("#{cbbyh}.triggers[0].show();");
            SelectLoad();
        }
    }
Exemplo n.º 26
0
 public ActionResult ResourceUpload(Cumplimiento model, HttpPostedFileBase upload)
 {
     if (upload != null && upload.ContentLength <= (5 * 1000000))
     {
         string[] allowedExtensions = new[] { ".pdf", ".txt" };
         var      file = Path.GetExtension(DateTime.Now.ToString("yyyyMMddHHmmss") + "-" + upload.FileName).ToLower();
         var      ext  = file;
         foreach (var Ext in allowedExtensions)
         {
             if (Ext.Contains(file))
             {
                 file = (DateTime.Now.ToString("yyyyMMddHHmmss") + "-" + upload.FileName).ToLower();
                 upload.SaveAs(Server.MapPath("~/App_Data/" + file));
                 string ruta  = file;
                 var    cumpl = ApplicationDbContext.Tb_Cumplimiento.Find(model.Cump_Id);
                 //cumpl.Cump_Aevidencia = ruta;
                 //cumpl.Cump_Contenido = ext;
                 ApplicationDbContext.SaveChanges();
                 return(RedirectToAction("Upload", new { id = model.Cump_Id }));
             }
         }
     }
     return(RedirectToAction("Upload"));
 }
Exemplo n.º 27
0
    public AssetBundle TryLoadAB(string path)
    {
        Debug.Log("trying to load ", path);
        var ab = AssetBundle.LoadFromFile(Dir.root + path);

        if (ab != null)
        {
            return(ab);
        }
        var key = Ext.HashToString(path.ToBytes()).Substring(0, 12);
        var alt = Dir.cache + key + ".unity3d";


        Vfs.Repack(realPath, alt, true);

        Debug.Log("no dice, trying alternat path at ", alt);
        var ret = AssetBundle.LoadFromFile(alt);

        if (ret == null)
        {
            Debug.Error("Bundle load (try 1) failed ", path);
        }
        return(ret);
    }
Exemplo n.º 28
0
    public void RouteMan()
    {
        RowSelectionModel sm = this.GridPanel1.SelectionModel.Primary as RowSelectionModel;

        if (sm.SelectedRows.Count > 0)
        {
            HBBLL hb = new HBBLL();
            TID.SetValue(sm.SelectedRows[0].RecordID.Trim());
            TID.Value = sm.SelectedRows[0].RecordID.Trim();
            TID.Text  = sm.SelectedRows[0].RecordID.Trim();

            string id = TID.Value.ToString();
            id             = TID.Text;
            lblDetail.Text = hb.GetYPPTNameByID(int.Parse(id));

            DetailWindow.Show();
            UpdateStatus1();
            Ext.DoScript("#{YPPTDetailStore}.reload();");
        }
        else
        {
            Ext.Msg.Alert("提示", "请选择一个模板!").Show();
        }
    }
Exemplo n.º 29
0
 public void ExtEtxt()
 {
     Assert.AreEqual("FOO", "foo".Capitalize());
     Assert.AreEqual("FOO", Ext.Capitalize("foo"));
 }
Exemplo n.º 30
0
        private WSServer()
        {
            var plugin = Registry.Resolve <PluginMain>();
            var cfg    = plugin.Config;

            _failed = false;

            try
            {
                var sslPath = GetCertPath();
                var secure  = cfg.WSServerSSL && File.Exists(sslPath);

                _server = new HttpServer(IPAddress.Parse(cfg.WSServerIP), cfg.WSServerPort, secure);
                _server.ReuseAddress = true;
                _server.Log.Output  += (LogData d, string msg) =>
                {
                    Log(LogLevel.Info, "WS: {0}: {1} {2}", d.Level.ToString(), d.Message, msg);
                };
                _server.Log.Level = WebSocketSharp.LogLevel.Info;

                if (secure)
                {
                    Log(LogLevel.Debug, Resources.WSLoadingCert, sslPath);

                    // IMPORTANT: Do *not* change the password here. This is the default password that mkcert uses.
                    // If you use a different password here, you'd have to pass it to mkcert and update the text on the WSServer tab to match.
                    _server.SslConfiguration.ServerCertificate   = new X509Certificate2(sslPath, "changeit");
                    _server.SslConfiguration.EnabledSslProtocols = System.Security.Authentication.SslProtocols.Tls11 | System.Security.Authentication.SslProtocols.Tls12;
                }

                _server.AddWebSocketService <SocketHandler>("/ws");
                _server.AddWebSocketService <LegacyHandler>("/MiniParse");
                _server.AddWebSocketService <LegacyHandler>("/BeforeLogLineRead");

                _server.OnGet += (object sender, HttpRequestEventArgs e) =>
                {
                    if (e.Request.RawUrl == "/")
                    {
                        var builder = new StringBuilder();
                        builder.Append(@"<!DOCTYPE html>
<html>
    <head>
        <title>OverlayPlugin WSServer</title>
    </head>
    <body>
        " + Resources.WSIndexPage + @"
        <ul>");

                        foreach (var overlay in plugin.Overlays)
                        {
                            if (overlay.GetType() != typeof(MiniParseOverlay))
                            {
                                continue;
                            }

                            var(confident, url) = GetUrl((MiniParseOverlay)overlay);

                            url = url.Replace("&", "&amp;").Replace("\"", "&quot;");
                            var overlayName = overlay.Name.Replace("&", "&amp;").Replace("<", "&lt;");

                            if (url.StartsWith("file://"))
                            {
                                builder.Append($"<li>Local: {overlayName}: {url}</li>");
                            }
                            else
                            {
                                builder.Append($"<li><a href=\"{url}\">{overlayName}</a>");
                            }

                            if (!confident)
                            {
                                builder.Append(" " + Resources.WSNotConfidentLink);
                            }

                            builder.Append("</li>");
                        }

                        builder.Append("</ul></body></html>");

                        var res = e.Response;
                        res.StatusCode  = 200;
                        res.ContentType = "text/html";
                        Ext.WriteContent(res, Encoding.UTF8.GetBytes(builder.ToString()));
                    }
                };

                _server.Start();
                OnStateChanged?.Invoke(this, new StateChangedArgs(true, false));
            }
            catch (Exception e)
            {
                _failed = true;
                Log(LogLevel.Error, Resources.WSStartFailed, e);
                OnStateChanged?.Invoke(this, new StateChangedArgs(false, true));
            }
        }
Exemplo n.º 31
0
 public BoundList(Ext.view.BoundListConfig config){}
 /// <summary>
 /// Fired immediately after the column header menu is created.
 /// </summary>
 /// <param name="ct"><p>This instance</p>
 /// </param>
 /// <param name="menu"><p>The Menu that was created</p>
 /// </param>
 /// <param name="eOpts"><p>The options object passed to <see cref="Ext.util.Observable.addListener">Ext.util.Observable.addListener</see>.</p>
 /// </param>
 public void menucreate(Ext.grid.header.Container ct, Ext.menu.Menu menu, object eOpts){}
 /// <summary>
 /// Parameters<li><span>ct</span> : <see cref="Ext.grid.header.Container">Ext.grid.header.Container</see><div><p>The grid's header Container which encapsulates all column headers.</p>
 /// </div></li><li><span>column</span> : <see cref="Ext.grid.column.Column">Ext.grid.column.Column</see><div><p>The Column header Component which provides the column definition</p>
 /// </div></li><li><span>eOpts</span> : <see cref="Object">Object</see><div><p>The options object passed to <see>Ext.util.Observable.addListener</see>.</p>
 /// </div></li>
 /// </summary>
 /// <param name="ct"><p>The grid's header Container which encapsulates all column headers.</p>
 /// </param>
 /// <param name="column"><p>The Column header Component which provides the column definition</p>
 /// </param>
 /// <param name="eOpts"><p>The options object passed to <see cref="Ext.util.Observable.addListener">Ext.util.Observable.addListener</see>.</p>
 /// </param>
 public void columnshow(Ext.grid.header.Container ct, Ext.grid.column.Column column, object eOpts){}
 /// <summary>
 /// Parameters<li><span>ct</span> : <see cref="Ext.grid.header.Container">Ext.grid.header.Container</see><div><p>The grid's header Container which encapsulates all column headers.</p>
 /// </div></li><li><span>column</span> : <see cref="Ext.grid.column.Column">Ext.grid.column.Column</see><div><p>The Column header Component which provides the column definition</p>
 /// </div></li><li><span>fromIdx</span> : <see cref="Number">Number</see><div>
 /// </div></li><li><span>toIdx</span> : <see cref="Number">Number</see><div>
 /// </div></li><li><span>eOpts</span> : <see cref="Object">Object</see><div><p>The options object passed to <see>Ext.util.Observable.addListener</see>.</p>
 /// </div></li>
 /// </summary>
 /// <param name="ct"><p>The grid's header Container which encapsulates all column headers.</p>
 /// </param>
 /// <param name="column"><p>The Column header Component which provides the column definition</p>
 /// </param>
 /// <param name="fromIdx">
 /// </param>
 /// <param name="toIdx">
 /// </param>
 /// <param name="eOpts"><p>The options object passed to <see cref="Ext.util.Observable.addListener">Ext.util.Observable.addListener</see>.</p>
 /// </param>
 public void columnmove(Ext.grid.header.Container ct, Ext.grid.column.Column column, JsNumber fromIdx, JsNumber toIdx, object eOpts){}
Exemplo n.º 35
0
    public static bool Repack(Stream input, Stream output, bool randomize = false, int lz4blockSize = 128 * 1024)
    {
        var baseStart = output.Position;
        var r         = new BinaryReader(input, Encoding.ASCII);
        var w         = new BinaryWriter(output, Encoding.ASCII);

        var format = r.GetString();

        if (format != "UnityFS")
        {
            return(false);
        }
        w.Put(format);

        var gen = r.GetInt();

        if (gen != 6)
        {
            return(false);
        }
        w.Put(gen);

        w.Put(r.GetString());
        w.Put(r.GetString());

        // defer
        var infoPos = w.BaseStream.Position;

        w.BaseStream.Position += 16;         // bundlesize + metacomp + metauncomp

        var bundleSize       = r.GetLong();
        var metaCompressed   = r.GetInt();
        var metaUncompressed = r.GetInt();
        var flags            = r.GetInt();

        w.Put(0x43);
        var dataPos = r.BaseStream.Position;

        if ((flags & 0x80) != 0)
        {
            r.BaseStream.Position = bundleSize - metaCompressed;
        }
        else
        {
            dataPos += metaCompressed;
        }

        byte[] metabuf = null;
        switch (flags & 0x3f)
        {
        case 3:
        case 2:
            metabuf = Ext.LZ4Decompress(r.ReadBytes(metaCompressed), 0, metaCompressed, metaUncompressed);
            break;

        case 0:
            metabuf = r.ReadBytes(metaUncompressed);
            break;

        default:
            return(false);
        }

        r.BaseStream.Position = dataPos;
        var meta    = new BinaryReader(new MemoryStream(metabuf), Encoding.ASCII);
        var newmeta = new BinaryWriter(new MemoryStream(), Encoding.ASCII);

        newmeta.BaseStream.Position += 16 + 4;         // +4 for pending.Length
        meta.BaseStream.Position    += 16;
        int           nblocks = meta.GetInt();
        List <byte[]> pending = new List <byte[]>();

        for (var i = 0; i < nblocks; i++)
        {
            var origSize   = meta.GetInt();
            var compSize   = meta.GetInt();
            var blockFlags = meta.GetShort();
            var block      = r.ReadBytes(compSize);
            if (blockFlags == 0x40 || blockFlags == 2 || blockFlags == 3)
            {
                if (blockFlags != 0x40)
                {
                    block = Ext.LZ4Decompress(block, 0, compSize, origSize);
                }
                for (int pos = 0; pos < block.Length; pos += lz4blockSize)
                {
                    var orig     = Math.Min(lz4blockSize, block.Length - pos);
                    var newblock = Ext.LZ4Compress(block, pos, orig);
                    newmeta.Put(orig);
                    newmeta.Put(newblock.Length);;
                    newmeta.Put((short)3);
                    pending.Add(newblock);
                }
            }
            else
            {
                newmeta.Put(origSize);
                newmeta.Put(compSize);
                newmeta.Put(blockFlags);
                pending.Add(block);
            }
        }

        //Console.WriteLine(pending.Count);
        int nfiles = meta.GetInt();

        newmeta.Put(nfiles);
        var rng = new RNGCryptoServiceProvider();

        for (int i = 0; i < nfiles; i++)
        {
            newmeta.Put(meta.GetLong());
            newmeta.Put(meta.GetLong());
            newmeta.Put(meta.GetInt());
            var name = meta.GetString();
            if (randomize)
            {
                var rnbuf = new byte[16];
                rng.GetBytes(rnbuf);
                name = "CAB-" + string.Concat(rnbuf.Select((x) => ((int)x).ToString("X2")).ToArray()).ToLower();
            }
            newmeta.Put(name);
        }
        newmeta.BaseStream.Position = 16;
        newmeta.Put(pending.Count);
        var newmetabuf  = (newmeta.BaseStream as MemoryStream).ToArray();
        var newmetabufc = Ext.LZ4Compress(newmetabuf, 0, newmetabuf.Length);

        w.Write(newmetabufc);
        foreach (var buf in pending)
        {
            w.Write(buf);
        }
        var endpos     = w.BaseStream.Position;
        var bundlesize = endpos - baseStart;

        w.BaseStream.Position = infoPos;
        w.Put(bundlesize);
        w.Put(newmetabufc.Length);
        w.Put(newmetabuf.Length);
        output.Position = endpos;
        return(true);
    }
Exemplo n.º 36
0
        /// <summary>
        /// 团体比赛结束一次对决
        /// </summary>
        /// <param name="currentUser">忽略</param>
        /// <param name="request">Request.GameLoop.Entities</param>
        /// <returns>Response.EmptyEntity</returns>
        public Response Execute(string request)
        {
            var req  = JsonConvert.DeserializeObject <Request <GameLoop> >(request);
            var temp = req.FirstEntity();

            //非轮空,非双方弃权,需要胜方签名
            if (!temp.IsBye && temp.WaiverOption != WaiverOption.AB && Ext.IsNullOrEmpty(temp.WinSign))
            {
                return(ResultHelper.Fail("非轮空,非双方弃权,需要胜方签名。"));
            }

            var loop = GameHelper.GetLoop(temp.Id);

            //从数据库取出,重新赋值
            loop.IsBye        = req.Entities.First().IsBye;
            loop.State        = GameLoopState.FINISH.Id;
            loop.WaiverOption = temp.WaiverOption.GetId();
            loop.WinSign      = temp.WinSign;
            loop.JudgeSign    = temp.JudgeSign;
            //更新结束时间
            loop.EndTime = DateTime.Now;
            if (loop.StartTime == null)
            {
                loop.StartTime = loop.EndTime;
            }
            loop.SetRowModified();

            loop.Team1Id = loop.Team1Id.GetId();
            loop.Team2Id = loop.Team2Id.GetId();

            IWaiver waiver = new TeamWaiver();

            if (loop.WaiverOption.IsNotNullOrEmpty())
            {
                waiver.SetWaiver(loop);
            }
            else
            {
                waiver.SetScore(loop);
                var order = GameHelper.GetGameOrder(loop.OrderId.GetId());

                //验证爱猕模式需要打完所有对阵
                if (order.TeamScoreMode == TeamScoreMode.SINGLE_RACE.Id)
                {
                    if (loop.Team1 + loop.Team2 != order.WinTeam * 2 - 1)
                    {
                        return(ResultHelper.Fail(string.Format("需要打满{0}场。", order.WinTeam * 2 - 1)));
                    }
                }
                else
                {
                    int max = loop.Team1 > loop.Team2 ? loop.Team1 : loop.Team2;
                    if (max < order.WinTeam)
                    {
                        //团队比赛胜场检查
                        return(ResultHelper.Fail(string.Format("胜方需要赢{0}场。", order.WinTeam)));
                    }
                }
            }

            List <EntityBase> entities = new List <EntityBase>();

            entities.Add(loop);
            SetNextLoop(loop, entities);

            var cmdSave = CommandHelper.CreateSave(entities);
            //更新个人积分
            var cmdUpdateScore = CommandHelper.CreateProcedure(FetchType.Execute, "sp_UpdateGameSportScoreForTeam");

            cmdUpdateScore.Params.Add("@GameId", loop.GameId);
            cmdUpdateScore.Params.Add("@LoopId", loop.Id.GetId());
            cmdSave.AfterCommands = new List <Command> {
                cmdUpdateScore
            };

            return(DbContext.GetInstance().Execute(cmdSave));
        }
Exemplo n.º 37
0
        private void bsDeploy_DoWork(object sender, DoWorkEventArgs e)
        {
            var updateDir      = txtDirectoryUpdate.Text.Trim();
            var destinationDir = txtDirectoryDestination.Text.Trim();
            var xmlFile        = Path.Combine(destinationDir, "update.txt");

            var xml = (XmlUpdate)e.Argument;

            //add files into xml
            foreach (var item in _fileInfo.Where(x => x.Checked))
            {
                xml.Files.Add(new XmlUpdate.XmlFile(item.Path, item.Path.Substring(updateDir.Length + 1), item.Hash));
            }
            var compressDir = Path.Combine(destinationDir, xml.CompressFolderName);

            if (!Directory.Exists(compressDir))
            {
                Directory.CreateDirectory(compressDir);
            }

            var deleteFiles = Directory.GetFiles(destinationDir).ToList();

            if (deleteFiles.Contains(xmlFile))
            {
                deleteFiles.Remove(xmlFile);
            }
            var deleteCompressedFiles = Directory.GetFiles(compressDir);

            var comparer = new PropertyComparer <XmlUpdate.XmlFile>("Hash");
            var distinct = xml.Files.Distinct(comparer).ToList();

            decimal max = deleteFiles.Count + deleteCompressedFiles.Length + distinct.Count;


            var oldCompressEqualsCurrent = false;

            if (File.Exists(xmlFile))
            {
                XmlUpdate oldXml = null;//Creating old serialized XmlUpdate from xml file
                try { oldXml = Ext.DeserializeXml <XmlUpdate>(File.ReadAllBytes(xmlFile)); }
                catch { }
                oldCompressEqualsCurrent = oldXml != null && oldXml.Compress == xml.Compress;
            }

            for (int i = 0; i < deleteFiles.Count; i++)
            {
                bsDeploy.ReportProgress((int)((1m + i) * progressFiles.Maximum / max), "Deleting: " + Path.GetFileName(deleteFiles[i]));
                File.Delete(deleteFiles[i]);
            }

            for (int i = 0; i < deleteCompressedFiles.Length; i++)
            {
                var file = Path.GetFileName(deleteCompressedFiles[i]);
                //if old compressed file equals current then just skip.
                if (oldCompressEqualsCurrent && distinct.Any(x => x.Hash + xml.Extension == file))
                {
                    continue;
                }

                bsDeploy.ReportProgress((int)((1m + deleteFiles.Count + i) * progressFiles.Maximum / max), "Deleting: " + file);
                File.Delete(deleteCompressedFiles[i]);
            }


            for (int i = 0; i < distinct.Count; i++)
            {
                var item = distinct[i];
                var file = Path.Combine(compressDir, item.Hash + xml.Extension);
                if (File.Exists(file))
                {
                    continue;                   //if old compressed file already exists then skip
                }
                bsDeploy.ReportProgress((int)((1 + deleteFiles.Count + deleteCompressedFiles.Length + i) * progressFiles.Maximum / max), "Compressing: " + Path.GetFileName(item.Path) + "  To: " + item.Hash + xml.Extension);
                switch (xml.Compress.ToLowerInvariant())
                {
                case "":
                    File.Copy(item.Path, file);
                    break;

                case "gzip":
                    GZipHelper.CompressFile(item.Path, file);
                    break;

                //case "zip":
                //    SharpZLibHelper.CompressFile(item.Path, Path.Combine(compressFolder, item.Hash + xml.Extension));
                //    progressFiles.PerformStep();
                //    break;

                case "7zip":
                    SevenZipHelper.CompressFileLZMA(item.Path, file);
                    break;

                default:
                    throw new ArgumentException("Invalid compress type (use: gzip, 7zip).");
                }
            }
            File.WriteAllText(xmlFile, Ext.SerializeXml(xml));
        }
Exemplo n.º 38
0
    protected void Cell_Click(object sender, AjaxEventArgs e)
    {
        CellSelectionModel sm = this.GridPanel1.SelectionModel.Primary as CellSelectionModel;

        if (sm.SelectedCell.ColIndex == 0 || sm.SelectedCell.Value.Trim() == "0")
        {
            return;
        }
        Window1.Title = dc.Department.First(p => p.Deptnumber == sm.SelectedCell.RecordID).Deptname.Trim() + "---";
        string url = "";

        switch (sm.SelectedCell.Name.Trim())
        {
        case "YHALL":
            Window1.Width  = 840;
            Window1.Height = 422;
            Window1.Title += "所有隐患";
            url            = string.Format("YHcondition.aspx?MainDeptID={0}&begin={1}&end={2}", sm.SelectedCell.RecordID.Trim(), dfBegin.SelectedDate.ToString("yyyy-MM-dd"), dfEnd.SelectedDate.ToString("yyyy-MM-dd"));
            break;

        case "YHYZG":
            Window1.Width  = 840;
            Window1.Height = 422;
            Window1.Title += "已闭合隐患";
            url            = string.Format("YHcondition.aspx?MainDeptID={0}&begin={1}&end={2}&status={3}", sm.SelectedCell.RecordID.Trim(), dfBegin.SelectedDate.ToString("yyyy-MM-dd"), dfEnd.SelectedDate.ToString("yyyy-MM-dd"), "1");
            break;

        case "YHWZG":
            Window1.Width  = 840;
            Window1.Height = 422;
            Window1.Title += "未闭合隐患";
            url            = string.Format("YHcondition.aspx?MainDeptID={0}&begin={1}&end={2}&status={3}", sm.SelectedCell.RecordID.Trim(), dfBegin.SelectedDate.ToString("yyyy-MM-dd"), dfEnd.SelectedDate.ToString("yyyy-MM-dd"), "0");
            break;

        case "A":
            Window1.Width  = 840;
            Window1.Height = 422;
            Window1.Title += "A级隐患";
            url            = string.Format("YHcondition.aspx?MainDeptID={0}&begin={1}&end={2}&YHLevel={3}", sm.SelectedCell.RecordID.Trim(), dfBegin.SelectedDate.ToString("yyyy-MM-dd"), dfEnd.SelectedDate.ToString("yyyy-MM-dd"), "A");
            break;

        case "B":
            Window1.Width  = 840;
            Window1.Height = 422;
            Window1.Title += "B级隐患";
            url            = string.Format("YHcondition.aspx?MainDeptID={0}&begin={1}&end={2}&YHLevel={3}", sm.SelectedCell.RecordID.Trim(), dfBegin.SelectedDate.ToString("yyyy-MM-dd"), dfEnd.SelectedDate.ToString("yyyy-MM-dd"), "B");
            break;

        case "C":
            Window1.Width  = 840;
            Window1.Height = 422;
            Window1.Title += "C级隐患";
            url            = string.Format("YHcondition.aspx?MainDeptID={0}&begin={1}&end={2}&YHLevel={3}", sm.SelectedCell.RecordID.Trim(), dfBegin.SelectedDate.ToString("yyyy-MM-dd"), dfEnd.SelectedDate.ToString("yyyy-MM-dd"), "C");
            break;

        case "D":
            Window1.Width  = 840;
            Window1.Height = 422;
            Window1.Title += "D级隐患";
            url            = string.Format("YHcondition.aspx?MainDeptID={0}&begin={1}&end={2}&YHLevel={3}", sm.SelectedCell.RecordID.Trim(), dfBegin.SelectedDate.ToString("yyyy-MM-dd"), dfEnd.SelectedDate.ToString("yyyy-MM-dd"), "D");
            break;

        case "SWALL":
            Window1.Width  = 890;
            Window1.Height = 400;
            Window1.Title += "三违信息";
            url            = string.Format("SWcondition.aspx?MainDeptID={0}&begin={1}&end={2}", sm.SelectedCell.RecordID.Trim(), dfBegin.SelectedDate.ToString("yyyy-MM-dd"), dfEnd.SelectedDate.ToString("yyyy-MM-dd"));
            break;

        case "YZ":
            Window1.Width  = 890;
            Window1.Height = 400;
            Window1.Title += "严重三违信息";
            url            = string.Format("SWcondition.aspx?MainDeptID={0}&begin={1}&end={2}&SWLevel={3}", sm.SelectedCell.RecordID.Trim(), dfBegin.SelectedDate.ToString("yyyy-MM-dd"), dfEnd.SelectedDate.ToString("yyyy-MM-dd"), "严重");
            break;

        case "YB":
            Window1.Width  = 890;
            Window1.Height = 400;
            Window1.Title += "一般三违信息";
            url            = string.Format("SWcondition.aspx?MainDeptID={0}&begin={1}&end={2}&SWLevel={3}", sm.SelectedCell.RecordID.Trim(), dfBegin.SelectedDate.ToString("yyyy-MM-dd"), dfEnd.SelectedDate.ToString("yyyy-MM-dd"), "一般");
            break;

        case "QW":
            Window1.Width  = 890;
            Window1.Height = 400;
            Window1.Title += "轻微三违信息";
            url            = string.Format("SWcondition.aspx?MainDeptID={0}&begin={1}&end={2}&SWLevel={3}", sm.SelectedCell.RecordID.Trim(), dfBegin.SelectedDate.ToString("yyyy-MM-dd"), dfEnd.SelectedDate.ToString("yyyy-MM-dd"), "轻微");
            break;

        case "YZD":
            Window1.Width  = 840;
            Window1.Height = 422;
            Window1.Title += "已走动信息";
            url            = string.Format("MPcondition.aspx?MainDeptID={0}&begin={1}&end={2}&status={3}", sm.SelectedCell.RecordID.Trim(), dfBegin.SelectedDate.ToString("yyyy-MM-dd"), dfEnd.SelectedDate.ToString("yyyy-MM-dd"), "1");
            break;

        case "WZD":
            Window1.Width  = 840;
            Window1.Height = 422;
            Window1.Title += "未走动信息";
            url            = string.Format("MPcondition.aspx?MainDeptID={0}&begin={1}&end={2}&status={3}", sm.SelectedCell.RecordID.Trim(), dfBegin.SelectedDate.ToString("yyyy-MM-dd"), dfEnd.SelectedDate.ToString("yyyy-MM-dd"), "0");
            break;

        //--------------------
        case "FXCZG":
            Window1.Width  = 840;
            Window1.Height = 422;
            Window1.Title += "非现场整改隐患";
            url            = string.Format("YHcondition.aspx?MainDeptID={0}&begin={1}&end={2}&status={3}", sm.SelectedCell.RecordID.Trim(), dfBegin.SelectedDate.ToString("yyyy-MM-dd"), dfEnd.SelectedDate.ToString("yyyy-MM-dd"), "2");
            break;

        case "XCZG":
            Window1.Width  = 840;
            Window1.Height = 422;
            Window1.Title += "现场整改隐患";
            url            = string.Format("YHcondition.aspx?MainDeptID={0}&begin={1}&end={2}&status={3}", sm.SelectedCell.RecordID.Trim(), dfBegin.SelectedDate.ToString("yyyy-MM-dd"), dfEnd.SelectedDate.ToString("yyyy-MM-dd"), "3");
            break;

        case "KC":
            Window1.Width  = 840;
            Window1.Height = 422;
            Window1.Title += "矿查隐患";
            url            = string.Format("YHcondition.aspx?MainDeptID={0}&begin={1}&end={2}&status={3}", sm.SelectedCell.RecordID.Trim(), dfBegin.SelectedDate.ToString("yyyy-MM-dd"), dfEnd.SelectedDate.ToString("yyyy-MM-dd"), "4");
            break;

        case "ZC":
            Window1.Width  = 840;
            Window1.Height = 422;
            Window1.Title += "自查隐患";
            url            = string.Format("YHcondition.aspx?MainDeptID={0}&begin={1}&end={2}&status={3}", sm.SelectedCell.RecordID.Trim(), dfBegin.SelectedDate.ToString("yyyy-MM-dd"), dfEnd.SelectedDate.ToString("yyyy-MM-dd"), "5");
            break;

        case "SJPC":
            Window1.Width  = 840;
            Window1.Height = 422;
            Window1.Title += "上级排查隐患";
            url            = string.Format("YHcondition.aspx?MainDeptID={0}&begin={1}&end={2}&status={3}", sm.SelectedCell.RecordID.Trim(), dfBegin.SelectedDate.ToString("yyyy-MM-dd"), dfEnd.SelectedDate.ToString("yyyy-MM-dd"), "6");
            break;

        case "TBYZ":
            Window1.Width  = 890;
            Window1.Height = 400;
            Window1.Title += "特别严重三违信息";
            url            = string.Format("SWcondition.aspx?MainDeptID={0}&begin={1}&end={2}&SWLevel={3}", sm.SelectedCell.RecordID.Trim(), dfBegin.SelectedDate.ToString("yyyy-MM-dd"), dfEnd.SelectedDate.ToString("yyyy-MM-dd"), "特别严重");
            break;

        case "BGFXW":
            Window1.Width  = 890;
            Window1.Height = 400;
            Window1.Title += "不规范行为三违信息";
            url            = string.Format("SWcondition.aspx?MainDeptID={0}&begin={1}&end={2}&SWLevel={3}", sm.SelectedCell.RecordID.Trim(), dfBegin.SelectedDate.ToString("yyyy-MM-dd"), dfEnd.SelectedDate.ToString("yyyy-MM-dd"), "不规范行为");
            break;
        }
        //url=Server.HtmlEncode(url);
        Ext.DoScript("#{Window1}.load('" + url + "');");
        Window1.Show();
    }
Exemplo n.º 39
0
 public string BaseSave()
 {
     if (df_begin.SelectedValue == null || cbbBc.SelectedIndex == -1 || cbbPerson.SelectedIndex == -1)
     {
         //Ext.Msg.Alert("提示", "请填写完整信息!").Show();
         return("请填写完整信息!");
     }
     if (df_begin.SelectedDate < System.DateTime.Today)
     {
         //Ext.Msg.Alert("提示", "只能制定本日及以后的计划!").Show();
         return("只能制定本日及以后的计划!");
     }
     if (dc.YChargetable.Where(p => p.Cdate == df_begin.SelectedDate && p.Cbanci == cbbBc.SelectedItem.Value && p.Cperson == cbbPerson.SelectedItem.Value).Count() > 0)
     {
         //Ext.Msg.Alert("提示", "已添加的计划!").Show();
         return("已添加的计划!");
     }
     if (cboPlaceTemplate.SelectedIndex <= -1)
     {
         YChargetable ct = new YChargetable
         {
             Recordtime = System.DateTime.Now,
             Rperson    = SessionBox.GetUserSession().PersonNumber,
             Cdate      = df_begin.SelectedDate,
             Cbanci     = cbbBc.SelectedItem.Value,
             Cperson    = cbbPerson.SelectedItem.Value,
             Maindept   = SessionBox.GetUserSession().DeptNumber,
             Status     = 1
         };
         dc.YChargetable.InsertOnSubmit(ct);
         dc.SubmitChanges();
         //RecordAction(ct.Id, "新增");
         //Ext.Msg.Alert("提示", "新增成功!").Show();
         Ext.DoScript("#{Store1}.reload();");
         return("新增成功!");
     }
     else if (cboPlaceTemplate.SelectedItem.Value != "-1")
     {
         HBBLL hb = new HBBLL();
         if (hb.HaveMoveTemplate(int.Parse(cboPlaceTemplate.SelectedItem.Value)) > 0)
         {
             DateTime     dt = System.DateTime.Now;
             YChargetable ct = new YChargetable
             {
                 Recordtime = dt,
                 Rperson    = SessionBox.GetUserSession().PersonNumber,
                 Cdate      = df_begin.SelectedDate,
                 Cbanci     = cbbBc.SelectedItem.Value,
                 Cperson    = cbbPerson.SelectedItem.Value,
                 Maindept   = SessionBox.GetUserSession().DeptNumber,
                 Status     = 1
             };
             dc.YChargetable.InsertOnSubmit(ct);
             dc.SubmitChanges();
             foreach (YPPTDetail pt in hb.GetYPPTDetail(int.Parse(cboPlaceTemplate.SelectedItem.Value), "", SessionBox.GetUserSession().DeptNumber, ""))
             {
                 YPlanplace pp = new YPlanplace
                 {
                     Ctid       = ct.Id,
                     Recordtime = dt,
                     Placeid    = decimal.Parse(pt.PlaceId.ToString()),
                     Moveorder  = decimal.Parse(pt.MoveOrder.ToString())
                 };
                 hb.AddYPlanplace(pp.Recordtime, pp.Placeid, pp.Moveorder.Value, pp.Ctid);
                 //dc.YPlanplace.InsertOnSubmit(pp);
                 //dc.SubmitChanges();
             }
             //RecordAction(ct.Id, "新增");
             //RecordAction(ct.Id, "添加地点");
             //Ext.Msg.Alert("提示", "新增成功!").Show();
             //storeload();
             Ext.DoScript("#{Store1}.reload();");
             return("新增成功!");
         }
         else
         {
             //Ext.Msg.Alert("提示", "请确保模板里有走动线路!").Show();
             return("请确保模板里有走动线路!");
         }
     }
     else
     {
         //Ext.Msg.Alert("提示", "未知错误!").Show();
         return("未知错误!");
     }
 }
Exemplo n.º 40
0
        public void Print()
        {
            byte[] buffer;
            long   count, i, j;
            int    countDigit, remainder;
            string countFmt, extPayloadLen, headerFmt, topLineFmt, bottomLineFmt, payloadData, spFmt;

            switch (ExtPayloadLen.Length)
            {
            case 2:
                extPayloadLen = Ext.To <ushort>(ExtPayloadLen, ByteOrder.BIG).ToString();
                break;

            case 8:
                extPayloadLen = Ext.To <ulong>(ExtPayloadLen, ByteOrder.BIG).ToString();
                break;

            default:
                extPayloadLen = String.Empty;
                break;
            }

            if (((Opcode.TEXT | Opcode.PING | Opcode.PONG) & Opcode) == Opcode &&
                Masked == Mask.UNMASK &&
                PayloadLength > 0)
            {
                payloadData = Encoding.UTF8.GetString(PayloadData.ToBytes());
            }
            else
            {
                payloadData = BitConverter.ToString(PayloadData.ToBytes());
            }

            headerFmt = @"
 WsFrame:

 FIN={0}, RSV1={1}, RSV2={2}, RSV3={3}, Opcode={4},
 MASK={5}, Payload Len={6}, Extended Payload Len={7},
 Masking Key ={8},
 Payload Data={9}";

            buffer    = ToBytes();
            count     = (long)(Length / 4);
            remainder = (int)(Length % 4);

            if (count < 10000)
            {
                countDigit = 4;
                countFmt   = "{0,4}";
            }
            else if (count < 0x010000)
            {
                countDigit = 4;
                countFmt   = "{0,4:X}";
            }
            else if (count < 0x0100000000)
            {
                countDigit = 8;
                countFmt   = "{0,8:X}";
            }
            else
            {
                countDigit = 16;
                countFmt   = "{0,16:X}";
            }

            spFmt = String.Format("{{0,{0}}}", countDigit);

            topLineFmt = String.Format(@"
 {0} 01234567 89ABCDEF 01234567 89ABCDEF
 {0}+--------+--------+--------+--------+", spFmt);

            Func <string, Action <string, string, string, string> > func = s =>
            {
                long   lineCount = 0;
                string lineFmt   = String.Format(" {0}|{{1,8}} {{2,8}} {{3,8}} {{4,8}}|", s);
                return((arg1, arg2, arg3, arg4) =>
                {
                    Console.WriteLine(lineFmt, ++lineCount, arg1, arg2, arg3, arg4);
                });
            };
            var printLine = func(countFmt);

            bottomLineFmt = String.Format(" {0}+--------+--------+--------+--------+", spFmt);

            Console.WriteLine(headerFmt,
                              Fin, Rsv1, Rsv2, Rsv3, Opcode,
                              Masked, PayloadLen, extPayloadLen,
                              BitConverter.ToString(MaskingKey),
                              payloadData);

            Console.WriteLine(topLineFmt, String.Empty);

            for (i = 0; i <= count; i++)
            {
                j = i * 4;
                if (i < count)
                {
                    printLine(
                        Convert.ToString(buffer[j], 2).PadLeft(8, '0'),
                        Convert.ToString(buffer[j + 1], 2).PadLeft(8, '0'),
                        Convert.ToString(buffer[j + 2], 2).PadLeft(8, '0'),
                        Convert.ToString(buffer[j + 3], 2).PadLeft(8, '0'));
                }
                else if (i == count && remainder > 0)
                {
                    printLine(
                        Convert.ToString(buffer[j], 2).PadLeft(8, '0'),
                        remainder >= 2 ? Convert.ToString(buffer[j + 1], 2).PadLeft(8, '0') : String.Empty,
                        remainder == 3 ? Convert.ToString(buffer[j + 2], 2).PadLeft(8, '0') : String.Empty,
                        String.Empty);
                }
            }

            Console.WriteLine(bottomLineFmt, String.Empty);
        }
Exemplo n.º 41
0
 private static WsFrame parse(Stream stream, bool unmask)
 {
     return(parse(Ext.ReadBytes(stream, 2), stream, unmask));
 }
        public ActionResult Check(string FId, string checkType)
        {
            bool result = false;

            if ((!string.IsNullOrEmpty(FId)) && (!string.IsNullOrEmpty(checkType)))
            {
                result = operationalPlanApp.CheckForm(operationalPlanApp.GetForm(FId), Ext.ToBool(checkType));
            }
            if (result)
            {
                return(Success("操作成功。"));
            }
            else
            {
                return(Error("操作失败。"));
            }
        }
Exemplo n.º 43
0
    public static bool GetSprite(string bundle, string name, out Sprite ret)
    {
        ret = null;
        var lab = LoadedAssetBundle.Load(bundle);

        if (lab == null)
        {
            return(false);
        }
        if (!caching)
        {
            var t = LoadedAssetBundle.Load(bundle)?.LoadAsset(name, typeof(Texture2D)) as Texture2D;
            if (t == null)
            {
                return(false);
            }
            ret = Sprite.Create(t, new Rect(0f, 0f, (float)t.width, (float)t.height), new Vector2(0.5f, 0.5f));
            return(true);
        }
        Debug.Log("Trying to get sprite for ", bundle, name);
        if (lab.cachedSprites.TryGetValue(name, out int idx))
        {
            /*if (scache.TryGetValue(idx, out Sprite sc))
             * {
             *      if (sc)
             *              sc = Sprite.Instantiate(sc);
             *      return sc;
             * }*/
            Debug.Log("potential cache hit at ", idx, atlas.Length);
            int atlasno = (idx / spriteCount);
            int off     = idx % spriteCount;
            // load atlases up to that count
            for (int i = atlas.Length; i <= atlasno; i++)
            {
                var atn = Dir.cache + "abinfo" + i;
                if (File.Exists(atn))
                {
#if USE_BC7
                    var fmt  = TextureFormat.BC7;
                    var dbuf = new byte[atlasDim * atlasDim];
#elif USE_DXT
                    var fmt  = TextureFormat.DXT5;
                    var dbuf = new byte[atlasDim * atlasDim];
#else
                    var fmt  = TextureFormat.RGBA32;
                    var dbuf = new byte[4 * atlasDim * atlasDim];
#endif
                    Texture2D at = new Texture2D(atlasDim, atlasDim, fmt, false);
                    at.LoadRawTextureData(Ext.LZ4Decompress(File.ReadAllBytes(atn), dbuf));
                    at.Apply(updateMipmaps: false, makeNoLongerReadable: true);
                    if (atlas.Length <= i)
                    {
                        Array.Resize(ref atlas, i + 1);
                    }
                    Texture2D.DontDestroyOnLoad(at);
                    atlas[i] = at;
                }
                else
                {
                    Debug.Log("This cache index ", idx, " doesn't exist but should! (atlasno ", i, ")", atn);
                    break;
                }
            }
            if (atlasno < atlas.Length)
            {
                Debug.Log("Sprite within atlas range");
                int x  = (off % perDim) * 128;
                int y  = (off / perDim) * 128;
                var st = Sprite.Create(atlas[atlasno], new Rect(x, y, 128, 128), new Vector2(0.5f, 0.5f));
                //Sprite.DontDestroyOnLoad(st);
                //scache[idx] = st;
                ret = st;                // Sprite.Instantiate(st);
                return(true);
            }
            if (atlasno == atlas.Length)
            {
                if (off < spriteLen)
                {
                    Debug.Log("Found the sprite in pending set");
                    return(spritePending[off] ? Sprite.Instantiate(spritePending[off]) : null);
                }
            }
            Debug.Error("Corrupted sprite cache. This shouldn't happen.", atlasno, atlas.Length, off, spriteLen);
        }
        Debug.Log("cache miss. we need to cache the sprite afresh.");
        var tex      = LoadedAssetBundle.Load(bundle)?.LoadAsset(name, typeof(Texture2D)) as Texture2D;
        int localidx = spriteLen;
        lab.cachedSprites[name] = localidx + atlas.Length * spriteCount;
        spriteLen = localidx + 1;
        if (tex != null)
        {
        }

        /*scache[idx] = tex ? Sprite.Create(tex, new Rect(0f, 0f, (float)tex.width, (float)tex.height), new Vector2(0.5f, 0.5f)) : null;
         * if (tex != null)
         *      Sprite.DontDestroyOnLoad(scache[idx]);
         * spritePending[localidx] = scache[idx];
         * if (tex != null)
         *      ret = Sprite.Instantiate(scache[idx]);
         */
        ret = spritePending[localidx] = tex ? Sprite.Create(tex, new Rect(0f, 0f, (float)tex.width, (float)tex.height), new Vector2(0.5f, 0.5f)) : null;
        if (ret != null)
        {
            Sprite.DontDestroyOnLoad(ret);
        }
        // swap out the pending ones into a new texture if full
        if (spriteLen == spriteCount)
        {
            Debug.Log("sprite atlas full, flushing");
            Texture2D at = new Texture2D(atlasDim, atlasDim, TextureFormat.RGBA32, false);

            RenderTexture tmp = RenderTexture.GetTemporary(128, 128);
            tmp.filterMode       = FilterMode.Point;
            RenderTexture.active = tmp;
            for (int off = 0; off < spriteCount; off++)
            {
                if (spritePending[off] == null)
                {
                    continue;
                }
                int x = (off % perDim) * 128;
                int y = (off / perDim) * 128;
                Graphics.Blit(spritePending[off].texture, tmp);                 // blit and stretch the original to our 128x128 render target
                at.ReadPixels(new Rect(0, 0, 128, 128), x, y);
                spritePending[off] = null;
            }
            at.Apply();
            RenderTexture.active = null;
            int atno = atlas.Length;
            Array.Resize(ref atlas, atno + 1);
            atlas[atno] = at;
#if GAME_DEBUG
            File.WriteAllBytes(Dir.cache + "abinfo" + atno + ".png", at.EncodeToPNG());
#endif

#if USE_BC7
            var rawbuf = at.GetRawTextureData();
            var bc7buf = new byte[rawbuf.Length / 4];
            unsafe
            {
                fixed(byte *pbc7buf = bc7buf)
                {
                    fixed(byte *prawbuf = rawbuf)
                    bc7_compress(new IntPtr(pbc7buf), new IntPtr(prawbuf), atlasDim, atlasDim);
                }
            }
            rawbuf = bc7buf;
#elif USE_DXT
            at.Compress(false);
            var rawbuf = at.GetRawTextureData();
#else
            var rawbuf = at.GetRawTextureData();
#endif
            File.WriteAllBytes(Dir.cache + "abinfo" + atno, Ext.LZ4Compress(rawbuf));

            spriteLen = 0;
            Save();
        }
        return(ret != null);
    }
Exemplo n.º 44
0
    public void AddClick(string action)
    {
        if (cbbBc.SelectedIndex == -1 || cbbDept.SelectedIndex == -1 || cbbplace.SelectedIndex == -1 || cbbyh.SelectedIndex == -1 || dfPCtime.SelectedValue == null || cbbPerson.SelectedIndex == -1)//hdnPerson.Value.ToString().Trim()=="")
        {
            Ext.Msg.Alert("提示", "请填写完整信息!").Show();
            return;
        }
        string[] pergroup = cbbPerson.SelectedItem.Value.Trim().Split(',');//hdnPerson.Value.ToString().Split(',');//排查人数组
        if (action == "new")
        {
            //获取各班次截止时间
            string time = "00:00:00";
            switch (cbbBc.SelectedItem.Value.Trim())
            {
            case "早班":
                time = PublicMethod.ReadXmlReturnNode("ZBSJ", this);
                break;

            case "中班":
                time = PublicMethod.ReadXmlReturnNode("ZHBSJ", this);
                break;

            case "夜班":
                time = PublicMethod.ReadXmlReturnNode("WBSJ", this);
                break;
            }
            //可录入时间为当班时间+4小时
            DateTime btime = DateTime.Parse(System.DateTime.Today.ToString("yyyy-MM-dd") + " " + time).AddHours(-10); //起始时间
            DateTime etime = DateTime.Parse(System.DateTime.Today.ToString("yyyy-MM-dd") + " " + time).AddHours(2);   //截止时间
            if (btime.Day < System.DateTime.Today.Day)
            {
                btime = btime.AddDays(1);
            }
            if (etime.Day > System.DateTime.Today.Day)
            {
                etime = etime.AddDays(-1);
            }
            if (etime > btime)
            {
                if (System.DateTime.Now < btime || System.DateTime.Now > etime)
                {
                    Ext.Msg.Alert("提示", "不在当日" + cbbBc.SelectedItem.Value.Trim() + "隐患提交时间!").Show();
                    return;
                }
            }
            else
            {
                if (System.DateTime.Now < btime && System.DateTime.Now > etime)
                {
                    Ext.Msg.Alert("提示", "不在当日" + cbbBc.SelectedItem.Value.Trim() + "隐患提交时间!").Show();
                    return;
                }
            }
            try
            {
                var yho = dc.Nyhinput.Where(
                    p =>
                    p.Yhid == decimal.Parse(cbbyh.SelectedItem.Value.Trim()) &&
                    p.Deptid == cbbDept.SelectedItem.Value.Trim() &&
                    p.Placeid == int.Parse(cbbplace.SelectedItem.Value.Trim()) &&
                    new string[] { "新增", "提交审批", "隐患未整改", "逾期未整改" }.Contains(p.Status));
                if (yho.Count() > 0)
                {
                    AddYhMorePerson(yho.First().Yhputinid, pergroup);

                    GhtnTech.SecurityFramework.BLL.LogManager.WriteLog(SessionBox.GetUserSession().PersonNumber, SessionBox.GetUserSession().LoginName, "", DateTime.Now, GhtnTech.SecurityFramework.BLL.ActiveType.录入隐患, yho.First().Yhputinid.ToString(), "");
                    Ext.Msg.Alert("提示", "执行隐患合并操作!并入隐患编号为:" + yho.First().Yhputinid).Show(); //+ ";合并明细:<br>"+).Show();
                }
                else
                {
                    //现场整改隐患处理:同班下同一人判断为重复录入,多人或其他人录入并入隐患
                    var yho_s = dc.Nyhinput.Where(
                        p =>
                        p.Yhid == decimal.Parse(cbbyh.SelectedItem.Value.Trim()) &&
                        p.Deptid == cbbDept.SelectedItem.Value.Trim() &&
                        p.Placeid == int.Parse(cbbplace.SelectedItem.Value.Trim()) &&
                        p.Status == "现场整改" && p.Banci == cbbBc.SelectedItem.Value.Trim() && p.Pctime == Convert.ToDateTime(dfPCtime.Value));
                    if (yho_s.Count() > 0)
                    {
                        if (pergroup.Length == 1 && pergroup[0] == yho_s.First().Personid)
                        {
                            Ext.Msg.Alert("提示", "不能重复录入隐患信息!").Show();
                            return;
                        }
                        else
                        {
                            AddYhMorePerson(yho.First().Yhputinid, pergroup);


                            GhtnTech.SecurityFramework.BLL.LogManager.WriteLog(SessionBox.GetUserSession().PersonNumber, SessionBox.GetUserSession().LoginName, "", DateTime.Now, GhtnTech.SecurityFramework.BLL.ActiveType.录入隐患, yho.First().Yhputinid.ToString(), "");
                            Ext.Msg.Alert("提示", "执行隐患合并操作!并入隐患编号为:" + yho.First().Yhputinid).Show();// + ";合并明细:<br>" + ).Show();
                            Ext.DoScript("#{YHputinStore}.reload();");
                            return;
                        }
                    }
                    var      lel = dc.Getyhandhazusing.Where(p => p.Yhid == decimal.Parse(cbbyh.SelectedItem.Value.Trim()) && p.Deptnumber == SessionBox.GetUserSession().DeptNumber);
                    Nyhinput yh  = new Nyhinput();
                    yh.Banci         = cbbBc.SelectedItem.Value.Trim();
                    yh.Deptid        = cbbDept.SelectedItem.Value.Trim();
                    yh.Inputpersonid = SessionBox.GetUserSession().PersonNumber; //cbbPerson.SelectedItem.Value.Trim();
                    DateTime dt = System.DateTime.Now;                           //当前时间 插入多人用
                    yh.Personid   = pergroup[0];                                 //cbbPerson.SelectedItem.Value.Trim();
                    yh.Intime     = dt;
                    yh.Pctime     = Convert.ToDateTime(dfPCtime.Value);
                    yh.Placeid    = int.Parse(cbbplace.SelectedItem.Value.Trim());
                    yh.Remarks    = TextArea1.Text.Trim();
                    yh.Status     = cbbStatus.SelectedItem.Value.Trim();
                    yh.Yhid       = decimal.Parse(cbbyh.SelectedItem.Value.Trim());
                    yh.Maindeptid = SessionBox.GetUserSession().DeptNumber;
                    yh.Jctype     = cbbJctype.SelectedIndex;
                    if (lel.Count() > 0)
                    {
                        yh.Levelid = lel.First().Levelid;
                    }
                    //修正状态为null的问题
                    if (string.IsNullOrEmpty(yh.Status))
                    {
                        yh.Status = "现场整改";
                    }
                    dc.Nyhinput.Insert(yh);
                    dc.SubmitChanges();

                    //if (cbbStatus.SelectedItem.Value.Trim() == "现场整改")
                    //{
                    //    string url = string.Format("FinePersonSelect.aspx?Post={0}&Mod={1}&Win={2}", dc.Nyhinput.First(p => p.Intime == dt && p.Inputpersonid == SessionBox.GetUserSession().PersonNumber).Yhputinid, "yh", FineWin.ClientID);
                    //    Ext.DoScript("#{FineWin}.load('" + url + "');#{FineWin}.show();");
                    //}
                    //else
                    //{
                    decimal yhinputid = dc.Nyhinput.First(p => p.Intime == dt && p.Inputpersonid == SessionBox.GetUserSession().PersonNumber).Yhputinid;
                    AddYhMorePerson(yhinputid, pergroup);
                    GhtnTech.SecurityFramework.BLL.LogManager.WriteLog(SessionBox.GetUserSession().PersonNumber, SessionBox.GetUserSession().LoginName, "", DateTime.Now, GhtnTech.SecurityFramework.BLL.ActiveType.录入隐患, yhinputid.ToString(), "");
                    Ext.Msg.Alert("提示", "保存成功!").Show();//排查人员添加明细:<br>"+).Show();
                    //}
                }
                //Gridload();
                Ext.DoScript("#{YHputinStore}.reload();");
                //清空隐患信息
                cbbyh.SelectedItem.Value = "";
                TextArea2.Text           = "";
            }
            catch (Exception ex)
            {
                Ext.Msg.Alert("提示", string.Format("保存失败,请稍候重试!\n原因:{0}", ex.Message)).Show();
            }
        }
        else
        {
            var yh = dc.Nyhinput.First(p => p.Yhputinid == decimal.Parse(Hidden1.Value.ToString().Trim()));
            try
            {
                yh.Banci         = cbbBc.SelectedItem.Value.Trim();
                yh.Deptid        = cbbDept.SelectedItem.Value.Trim();
                yh.Inputpersonid = SessionBox.GetUserSession().PersonNumber; // cbbPerson.SelectedItem.Value.Trim();
                yh.Personid      = pergroup[0];                              //cbbPerson.SelectedItem.Value.Trim();
                //yh.Intime = System.DateTime.Today;
                //yh.Pctime = Convert.ToDateTime(dfPCtime.Value);
                yh.Placeid = int.Parse(cbbplace.SelectedItem.Value.Trim());
                yh.Remarks = TextArea1.Text.Trim();
                yh.Status  = cbbStatus.SelectedItem.Value.Trim();
                yh.Yhid    = decimal.Parse(cbbyh.SelectedItem.Value.Trim());
                yh.Jctype  = cbbJctype.SelectedIndex;
                //yh.Maindeptid = SessionBox.GetUserSession().DeptNumber;
                //dc.Yhinput.Insert(yh);
                dc.SubmitChanges();
                AddYhMorePerson(decimal.Parse(Hidden1.Value.ToString().Trim()), pergroup);
                Ext.Msg.Alert("提示", "修改成功!").Show();//排查人员添加明细:<br>" + ).Show();
                //Gridload();
                Ext.DoScript("#{YHputinStore}.reload();");
                //清空隐患信息
                cbbyh.SelectedIndex = -1;
                TextArea2.Text      = "";
            }
            catch
            {
                Ext.Msg.Alert("提示", "保存失败,请稍候重试!").Show();
            }
        }
    }
Exemplo n.º 45
0
        internal async void UpdateParameterInfoLocation()
        {
            var isCompletionWindowVisible = (CompletionWindowManager.Wnd?.Visible ?? false);
            var ctx = Widget?.CurrentCodeCompletionContext;

            if (ctx == null)
            {
                return;
            }
            var lineHeight = (int)Ext.Editor.LineHeight;
            var geometry   = Xwt.MessageDialog.RootWindow.Screen.VisibleBounds;
            var cmg        = ParameterInformationWindowManager.CurrentMethodGroup;

            int cparam = Ext != null ? await Ext.GetCurrentParameterIndex(cmg.MethodProvider.ApplicableSpan.Start) : 0;

            var lastW = (int)Width;
            var lastH = (int)Height;

            int X, Y;
            var pos = await cmg.CompletionContext.GetCoordinatesAsync();

            X = pos.x;
            if (isCompletionWindowVisible)
            {
                // place above
                Y = pos.y - lineHeight - (int)lastH - 10;
            }
            else
            {
                // place below
                Y = pos.y;
            }

            if (X + lastW > geometry.Right)
            {
                X = (int)geometry.Right - (int)lastW;
            }
            if (Y < geometry.Top)
            {
                Y = pos.y;
            }
            if (Y + lastH > geometry.Bottom)
            {
                Y = Y - lineHeight - (int)lastH - 4;
            }

            if (isCompletionWindowVisible)
            {
                var completionWindow = new Xwt.Rectangle(CompletionWindowManager.X, CompletionWindowManager.Y - lineHeight, CompletionWindowManager.Wnd.Allocation.Width, CompletionWindowManager.Wnd.Allocation.Height + lineHeight * 2);
                if (completionWindow.IntersectsWith(new Xwt.Rectangle(X, Y, lastW, lastH)))
                {
                    X = (int)completionWindow.X;
                    Y = (int)completionWindow.Y - (int)lastH - 6;
                    if (Y < 0)
                    {
                        Y = (int)completionWindow.Bottom + 6;
                    }
                }
            }
            Location = new Xwt.Point(X, Y);
        }
Exemplo n.º 46
0
 /// <summary>
 /// Fires when a date is selected
 /// </summary>
 /// <param name="this"><p>DatePicker</p>
 /// </param>
 /// <param name="date"><p>The selected date</p>
 /// </param>
 /// <param name="eOpts"><p>The options object passed to <see cref="Ext.util.Observable.addListener">Ext.util.Observable.addListener</see>.</p>
 /// </param>
 public void select(Ext.picker.Date @this, JsDate date, object eOpts){}
 /// <summary>
 /// Parameters<li><span>ct</span> : <see cref="Ext.grid.header.Container">Ext.grid.header.Container</see><div><p>The grid's header Container which encapsulates all column headers.</p>
 /// </div></li><li><span>column</span> : <see cref="Ext.grid.column.Column">Ext.grid.column.Column</see><div><p>The Column header Component which provides the column definition</p>
 /// </div></li><li><span>width</span> : <see cref="Number">Number</see><div>
 /// </div></li><li><span>eOpts</span> : <see cref="Object">Object</see><div><p>The options object passed to <see>Ext.util.Observable.addListener</see>.</p>
 /// </div></li>
 /// </summary>
 /// <param name="ct"><p>The grid's header Container which encapsulates all column headers.</p>
 /// </param>
 /// <param name="column"><p>The Column header Component which provides the column definition</p>
 /// </param>
 /// <param name="width">
 /// </param>
 /// <param name="eOpts"><p>The options object passed to <see cref="Ext.util.Observable.addListener">Ext.util.Observable.addListener</see>.</p>
 /// </param>
 public void columnresize(Ext.grid.header.Container ct, Ext.grid.column.Column column, JsNumber width, object eOpts){}
Exemplo n.º 48
0
 /// <summary>
 /// Makes the given card active (makes it the visible card in the TabPanel's CardLayout and highlights the Tab) ...
 /// </summary>
 public object setActiveTab(Ext.Component card){return null;}
 /// <summary>
 /// Parameters<li><span>ct</span> : <see cref="Ext.grid.header.Container">Ext.grid.header.Container</see><div><p>The grid's header Container which encapsulates all column headers.</p>
 /// </div></li><li><span>column</span> : <see cref="Ext.grid.column.Column">Ext.grid.column.Column</see><div><p>The Column header Component which provides the column definition</p>
 /// </div></li><li><span>e</span> : <see cref="Ext.EventObject">Ext.EventObject</see><div>
 /// </div></li><li><span>t</span> : HTMLElement<div>
 /// </div></li><li><span>eOpts</span> : <see cref="Object">Object</see><div><p>The options object passed to <see>Ext.util.Observable.addListener</see>.</p>
 /// </div></li>
 /// </summary>
 /// <param name="ct"><p>The grid's header Container which encapsulates all column headers.</p>
 /// </param>
 /// <param name="column"><p>The Column header Component which provides the column definition</p>
 /// </param>
 /// <param name="e">
 /// </param>
 /// <param name="t">
 /// </param>
 /// <param name="eOpts"><p>The options object passed to <see cref="Ext.util.Observable.addListener">Ext.util.Observable.addListener</see>.</p>
 /// </param>
 public void headertriggerclick(Ext.grid.header.Container ct, Ext.grid.column.Column column, EventObject e, object t, object eOpts){}
 public async Task <Order> Find(Guid Id)
 {
     return(await Ext.FindAsync(Context.Order, Id));
 }
 /// <summary>
 /// Parameters<li><span>ct</span> : <see cref="Ext.grid.header.Container">Ext.grid.header.Container</see><div><p>The grid's header Container which encapsulates all column headers.</p>
 /// </div></li><li><span>column</span> : <see cref="Ext.grid.column.Column">Ext.grid.column.Column</see><div><p>The Column header Component which provides the column definition</p>
 /// </div></li><li><span>direction</span> : <see cref="String">String</see><div>
 /// </div></li><li><span>eOpts</span> : <see cref="Object">Object</see><div><p>The options object passed to <see>Ext.util.Observable.addListener</see>.</p>
 /// </div></li>
 /// </summary>
 /// <param name="ct"><p>The grid's header Container which encapsulates all column headers.</p>
 /// </param>
 /// <param name="column"><p>The Column header Component which provides the column definition</p>
 /// </param>
 /// <param name="direction">
 /// </param>
 /// <param name="eOpts"><p>The options object passed to <see cref="Ext.util.Observable.addListener">Ext.util.Observable.addListener</see>.</p>
 /// </param>
 public void sortchange(Ext.grid.header.Container ct, Ext.grid.column.Column column, JsString direction, object eOpts){}
        private async void BtnGuardarBOMSDetalles_Clicked(object sender, EventArgs e)
        {
            string connectionString = ConfigurationManager.AppSettings["ipServer"];

            try
            {
                var BOMDIDV      = bomID;
                var PartNOV      = PartNo.Text;
                var DIEV         = DIE.Text;
                var ItemV        = Item.Text;
                var DescriptionV = Descripcion.Text;
                var UnitV        = Unit.Text;
                var UsageV       = Usage.Text;
                var CostV        = Costo.Text;
                var ExtV         = Ext.Text;

                if (string.IsNullOrEmpty(PartNOV))
                {
                    await DisplayAlert("Validacion", "Asegurarse de Ingresar el PartNo", "Aceptar");

                    PartNo.Focus();
                    return;
                }
                if (string.IsNullOrEmpty(DIEV))
                {
                    await DisplayAlert("Validacion", "Asegurarse de Ingresar el DIE", "Aceptar");

                    DIE.Focus();
                    return;
                }
                if (string.IsNullOrEmpty(ItemV))
                {
                    await DisplayAlert("Validacion", "Asegurarse de Ingresar el Item", "Aceptar");

                    Item.Focus();
                    return;
                }
                if (string.IsNullOrEmpty(DescriptionV))
                {
                    await DisplayAlert("Validacion", "Asegurarse de Ingresar la Descripcion", "Aceptar");

                    Descripcion.Focus();
                    return;
                }
                if (string.IsNullOrEmpty(UnitV))
                {
                    await DisplayAlert("Validacion", "Asegurarse de Ingresar el Unit", "Aceptar");

                    Unit.Focus();
                    return;
                }
                if (string.IsNullOrEmpty(UsageV))
                {
                    await DisplayAlert("Validacion", "Asegurarse de Ingresar el Usage", "Aceptar");

                    Usage.Focus();
                    return;
                }
                if (string.IsNullOrEmpty(CostV))
                {
                    await DisplayAlert("Validacion", "Asegurarse de Ingresar el Cost", "Aceptar");

                    Costo.Focus();
                    return;
                }
                if (string.IsNullOrEmpty(ExtV))
                {
                    await DisplayAlert("Validacion", "Asegurarse de Ingresar el Ext", "Aceptar");

                    Ext.Focus();
                    return;
                }

                HttpClient client = new HttpClient();
                client.BaseAddress = new Uri(connectionString);

                var BOMSDetalles = new BOMDetalles()
                {
                    BOMDetalleID = 0,
                    BOMID        = BOMDIDV,
                    PartNo       = PartNOV,
                    DIE          = DIEV,
                    Item         = ItemV,
                    Description  = DescriptionV,
                    Unit         = UnitV,
                    Usage        = Convert.ToDecimal(UsageV),
                    Cost         = Convert.ToDecimal(CostV),
                    Ext          = Convert.ToDecimal(ExtV)
                };

                //Convetir a Json
                var           json          = JsonConvert.SerializeObject(BOMSDetalles);
                StringContent stringContent = new StringContent(json, Encoding.UTF8, "application/json");

                //Ejecutar el api el introduces el metodo
                var request = await client.PostAsync("/api/BOMDetalle/registrar", stringContent);

                if (request.IsSuccessStatusCode)
                {
                    var responseJson = await request.Content.ReadAsStringAsync();

                    var respuesta = JsonConvert.DeserializeObject <Request>(responseJson);

                    //Status
                    if (respuesta.status)
                    {
                        await MaterialDialog.Instance.AlertAsync(message : "El Detalle del BOM se registro correctamente",
                                                                 title : "Registro",
                                                                 acknowledgementText : "Aceptar");
                    }
                    else
                    {
                        await MaterialDialog.Instance.AlertAsync(message : "El Detalle del BOM no pudo registrarse correctamente",
                                                                 title : "Registro",
                                                                 acknowledgementText : "Aceptar");
                    }
                }
                else
                {
                    await MaterialDialog.Instance.AlertAsync(message : "Error",
                                                             title : "Error",
                                                             acknowledgementText : "Aceptar");
                }
            }
            catch (Exception ex)
            {
                await MaterialDialog.Instance.AlertAsync(message : ex.Message,
                                                         title : "Error",
                                                         acknowledgementText : "Aceptar");
            }
            await Navigation.PushAsync(new Ingenieria.Ingenieria());
        }
 protected void btnSearch_DirectClick(object sender, Ext.Net.DirectEventArgs e)
 {
     int year = Convert.ToInt32(cmbYear.SelectedItem.Value);
     repBind(year);
 }
Exemplo n.º 54
0
Arquivo: Path.cs Projeto: envlang/env
 public static File Combine(this File a, Ext b)
 => new File(a + b);
Exemplo n.º 55
0
 public Date(Ext.picker.DateConfig config){}
Exemplo n.º 56
0
        public override void OnLoad(HttpContext context)
        {
            base.OnLoad(context);
            requestBody             = new RequestBody();
            requestBody.accessToken = context.Request["accessToken"];
            requestBody.page        = Convert.ToInt32(context.Request["page"]);
            requestBody.pageSize    = Convert.ToInt32(context.Request["pageSize"]);
            requestBody.status      = Convert.ToInt32(context.Request["status"]);
            if (requestBody.accessToken == null || requestBody.accessToken.Trim().Length == 0)
            {
                SystemResponse.Output(SystemResponse.TYPE_NULLPARAMETER, out statusCode, out responseJson);
            }
            else
            {
                //验证用户
                TokenHelper    token          = new TokenHelper();
                UserTokenModel userTokenModel = token.getUserToken(requestBody.accessToken);
                if (userTokenModel == null)
                {
                    SystemResponse.Output(SystemResponse.TYPE_EXPIRE, out statusCode, out responseJson);
                }
                else
                {
                    ModelAdo <OrderModel> orderModel = new ModelAdo <OrderModel>();
                    List <OrderModel>     models     = null;
                    int pagenumber = requestBody.page == 0 ? 1 : requestBody.page;
                    int totalCount = 1;
                    orderModel.PageSize = requestBody.pageSize == 0 ? orderModel.PageSize : requestBody.pageSize;
                    if (requestBody.status == 0)
                    {
                        models = orderModel.GetList(pagenumber, " uid=?uid ", "", out totalCount, "",
                                                    new MySqlParameter("?uid", userTokenModel.uid)
                                                    );
                    }
                    else
                    {
                        models = orderModel.GetList(pagenumber, " uid=?uid AND ostatus=?ostatus", "", out totalCount, "",
                                                    new MySqlParameter("?uid", Convert.ToInt32(userTokenModel.uid)),
                                                    new MySqlParameter("?ostatus", requestBody.status)
                                                    );
                    }
                    if (models.Count >= 1)
                    {
                        //构建返回对象
                        List <Order> orders = new List <Order>();
                        foreach (OrderModel model in models)
                        {
                            Order order = new Order();
                            order.uid        = model.uid.ToString();
                            order.title      = model.title;
                            order.createDate = string.Format("{0:d}", StringHelper.GetNomalTime(model.createDate));
                            order.status     = model.ostatus;
                            order.price      = model.amount.ToString("f2");
                            order.oid        = model.id.ToString();
                            order.type       = model.otid;
                            Ext from = new Ext();
                            from.uid   = model.uid.ToString();
                            from.city  = model.address1;
                            from.date  = string.Format("{0:d}", StringHelper.GetNomalTime(model.time1));
                            order.from = from;

                            Ext to = new Ext();
                            to.uid   = model.uid.ToString();
                            to.city  = model.address2;
                            to.date  = string.Format("{0:d}", StringHelper.GetNomalTime(model.time2));
                            order.to = to;

                            orders.Add(order);
                        }
                        responseBody = new ResponseBody
                        {
                            page      = 1,
                            pageTotal = (totalCount + orderModel.PageSize - 1) / orderModel.PageSize,
                            total     = totalCount,
                            orders    = orders
                        };
                        responseJson = JsonConvert.SerializeObject(responseBody, Formatting.Indented);
                    }
                    else
                    {
                        SystemResponse.Output(SystemResponse.TYPE_NULL, out statusCode, out responseJson);
                    }
                }
            }
        }
 /// <summary>
 /// Gets the cell (td) for a particular record and column.
 /// </summary>
 /// <param name="record">
 /// </param>
 /// <param name="column">
 /// </param>
 private void getCell(Ext.data.Model record, Ext.grid.column.Column column){}
Exemplo n.º 58
0
        /// <summary>
        /// 保存新增或改动的数据
        /// </summary>
        private void Save()
        {
            if (null != krpdgList.SelectedRows[0])
            {
                //如果是插入
                if (krpdgList.SelectedRows[0].Cells["krpcmRequestId"].Value.ToString().Equals("-1"))
                {
                    Request model = new Request();
                    try
                    {
                        // 隐藏功能时先把必要的复制掉(比如语言)
                        Common.GetCommon().CopyForHide(krpdgList.SelectedRows[0].Cells["krpcmRequestName0"], krpdgList.SelectedRows[0].Cells["krpcmRequestName1"], krpdgList.SelectedRows[0].Cells["krpcmRequestName2"], true, false, krpcbMultipleLanguage.Checked);

                        model.RequestId    = long.Parse(krpdgList.SelectedRows[0].Cells["krpcmRequestId"].Value.ToString());
                        model.RequestName0 = krpdgList.SelectedRows[0].Cells["krpcmRequestName0"].Value.ToString().Trim();
                        model.RequestName1 = krpdgList.SelectedRows[0].Cells["krpcmRequestName1"].Value.ToString().Trim();
                        model.RequestName2 = krpdgList.SelectedRows[0].Cells["krpcmRequestName2"].Value.ToString().Trim();
                        model.Order        = long.Parse(krpdgList.SelectedRows[0].Cells["krpcmOrder"].Value.ToString());
                        model.IsEnable     = long.Parse(krpdgList.SelectedRows[0].Cells["krpcmIsEnable"].Value.ToString());


                        //判断空
                        if (string.IsNullOrWhiteSpace(model.RequestName0) || string.IsNullOrWhiteSpace(model.RequestName1) || string.IsNullOrWhiteSpace(model.RequestName2))
                        {
                            KryptonMessageBox.Show(this, Resources.GetRes().GetString("CompleteInput"), Resources.GetRes().GetString("Warn"), MessageBoxButtons.OK, MessageBoxIcon.Warning);
                            return;
                        }

                        //判断是否已存在
                        if (Resources.GetRes().Requests.Where(x => (x.RequestName0.Equals(model.RequestName0, StringComparison.OrdinalIgnoreCase) || x.RequestName1.Equals(model.RequestName1, StringComparison.OrdinalIgnoreCase) || x.RequestName2.Equals(model.RequestName2, StringComparison.OrdinalIgnoreCase))).Count() > 0)
                        {
                            KryptonMessageBox.Show(this, string.Format(Resources.GetRes().GetString("PropertyExists"), Resources.GetRes().GetString("RequestName")), Resources.GetRes().GetString("Warn"), MessageBoxButtons.OK, MessageBoxIcon.Warning);
                            return;
                        }
                    }
                    catch (Exception ex)
                    {
                        ExceptionPro.ExpLog(ex, new Action <string>((message) =>
                        {
                            KryptonMessageBox.Show(this, message, Resources.GetRes().GetString("Warn"), MessageBoxButtons.OK, MessageBoxIcon.Warning);
                        }), false, Resources.GetRes().GetString("SaveFailt"));
                        return;
                    }

                    StartLoad(this, null);

                    Task.Factory.StartNew(() =>
                    {
                        try
                        {
                            bool result = OperatesService.GetOperates().ServiceAddRequest(model);

                            this.BeginInvoke(new Action(() =>
                            {
                                if (result)
                                {
                                    krpdgList.SelectedRows[0].Cells["krpcmRequestId"].Value = model.RequestId;
                                    KryptonMessageBox.Show(this, Resources.GetRes().GetString("SaveSuccess"), Resources.GetRes().GetString("Information"), MessageBoxButtons.OK, MessageBoxIcon.Information);
                                    krpdgList.SelectedRows[0].Cells["krpcmEdit"].Value = "";
                                    resultList.Insert(0, model);
                                    Resources.GetRes().Requests.Add(model);

                                    ReloadRequestTextbox();
                                }
                                else
                                {
                                    KryptonMessageBox.Show(this, Resources.GetRes().GetString("SaveFailt"), Resources.GetRes().GetString("Warn"), MessageBoxButtons.OK, MessageBoxIcon.Warning);
                                }
                            }));
                        }
                        catch (Exception ex)
                        {
                            this.BeginInvoke(new Action(() =>
                            {
                                ExceptionPro.ExpLog(ex, new Action <string>((message) =>
                                {
                                    KryptonMessageBox.Show(this, message, Resources.GetRes().GetString("Warn"), MessageBoxButtons.OK, MessageBoxIcon.Warning);
                                }), false, Resources.GetRes().GetString("SaveFailt"));
                            }));
                        }
                        StopLoad(this, null);
                    });
                }
                //如果是编辑
                else
                {
                    Request model = new Request();
                    try
                    {
                        model.RequestId = long.Parse(krpdgList.SelectedRows[0].Cells["krpcmRequestId"].Value.ToString());

                        model = Resources.GetRes().Requests.Where(x => x.RequestId == model.RequestId).FirstOrDefault().FastCopy();

                        // 隐藏功能时先把必要的复制掉(比如语言)
                        Common.GetCommon().CopyForHide(krpdgList.SelectedRows[0].Cells["krpcmRequestName0"], krpdgList.SelectedRows[0].Cells["krpcmRequestName1"], krpdgList.SelectedRows[0].Cells["krpcmRequestName2"], false, Ext.AllSame(model.RequestName0, model.RequestName1, model.RequestName2), krpcbMultipleLanguage.Checked);

                        model.RequestName0 = krpdgList.SelectedRows[0].Cells["krpcmRequestName0"].Value.ToString().Trim();
                        model.RequestName1 = krpdgList.SelectedRows[0].Cells["krpcmRequestName1"].Value.ToString().Trim();
                        model.RequestName2 = krpdgList.SelectedRows[0].Cells["krpcmRequestName2"].Value.ToString().Trim();
                        model.Order        = long.Parse(krpdgList.SelectedRows[0].Cells["krpcmOrder"].Value.ToString());
                        model.IsEnable     = long.Parse(krpdgList.SelectedRows[0].Cells["krpcmIsEnable"].Value.ToString());


                        //判断空
                        if (string.IsNullOrWhiteSpace(model.RequestName0) || string.IsNullOrWhiteSpace(model.RequestName1) || string.IsNullOrWhiteSpace(model.RequestName2))
                        {
                            KryptonMessageBox.Show(this, Resources.GetRes().GetString("CompleteInput"), Resources.GetRes().GetString("Warn"), MessageBoxButtons.OK, MessageBoxIcon.Warning);
                            return;
                        }

                        //判断是否已存在
                        if (Resources.GetRes().Requests.Where(x => x.RequestId != model.RequestId && (x.RequestName0.Equals(model.RequestName0, StringComparison.OrdinalIgnoreCase) || x.RequestName1.Equals(model.RequestName1, StringComparison.OrdinalIgnoreCase) || x.RequestName2.Equals(model.RequestName2, StringComparison.OrdinalIgnoreCase))).Count() > 0)
                        {
                            KryptonMessageBox.Show(this, string.Format(Resources.GetRes().GetString("PropertyExists"), Resources.GetRes().GetString("RequestName")), Resources.GetRes().GetString("Warn"), MessageBoxButtons.OK, MessageBoxIcon.Warning);
                            return;
                        }
                    }
                    catch (Exception ex)
                    {
                        ExceptionPro.ExpLog(ex, new Action <string>((message) =>
                        {
                            KryptonMessageBox.Show(this, message, Resources.GetRes().GetString("Warn"), MessageBoxButtons.OK, MessageBoxIcon.Warning);
                        }), false, Resources.GetRes().GetString("SaveFailt"));
                        return;
                    }

                    StartLoad(this, null);

                    Task.Factory.StartNew(() =>
                    {
                        try
                        {
                            ResultModel result = OperatesService.GetOperates().ServiceEditRequest(model);

                            this.BeginInvoke(new Action(() =>
                            {
                                if (result.Result)
                                {
                                    KryptonMessageBox.Show(this, Resources.GetRes().GetString("SaveSuccess"), Resources.GetRes().GetString("Information"), MessageBoxButtons.OK, MessageBoxIcon.Information);
                                    krpdgList.SelectedRows[0].Cells["krpcmEdit"].Value = "";
                                    Request oldModel = resultList.Where(x => x.RequestId == model.RequestId).FirstOrDefault();

                                    int no = resultList.IndexOf(oldModel);
                                    resultList.RemoveAt(no);
                                    resultList.Insert(no, model);

                                    no = Resources.GetRes().Requests.IndexOf(oldModel);
                                    Resources.GetRes().Requests.RemoveAt(no);
                                    Resources.GetRes().Requests.Insert(no, model);

                                    ReloadRequestTextbox();
                                }
                                else
                                {
                                    if (result.UpdateModel)
                                    {
                                        KryptonMessageBox.Show(this, Resources.GetRes().GetString("PropertyUnSame"), Resources.GetRes().GetString("Warn"), MessageBoxButtons.OK, MessageBoxIcon.Warning);
                                    }
                                    else
                                    {
                                        KryptonMessageBox.Show(this, Resources.GetRes().GetString("SaveFailt"), Resources.GetRes().GetString("Warn"), MessageBoxButtons.OK, MessageBoxIcon.Warning);
                                    }
                                }
                            }));
                        }
                        catch (Exception ex)
                        {
                            this.BeginInvoke(new Action(() =>
                            {
                                ExceptionPro.ExpLog(ex, new Action <string>((message) =>
                                {
                                    KryptonMessageBox.Show(this, message, Resources.GetRes().GetString("Warn"), MessageBoxButtons.OK, MessageBoxIcon.Warning);
                                }), false, Resources.GetRes().GetString("SaveFailt"));
                            }));
                        }
                        StopLoad(this, null);
                    });
                }
            }
        }
Exemplo n.º 59
0
 public Panel(Ext.tab.PanelConfig config){}
Exemplo n.º 60
0
        public override void PreBuildSync()
        {
            // no need to sync on the Mac!
            if (BuildHostPlatform.Current.Platform == UnrealTargetPlatform.Mac)
            {
                return;
            }

            if (bUseRPCUtil)
            {
                string ExtString = "";

                // look only for useful extensions
                foreach (string Ext in RsyncExtensions)
                {
                    // for later ls
                    ExtString += Ext.StartsWith(".") ? ("*" + Ext) : Ext;
                    ExtString += " ";
                }

                List <string> BatchUploadCommands = new List <string>();
                // for each directory we visited, add all the files in that directory
                foreach (string Dir in RsyncDirs)
                {
                    List <string> LocalFilenames = new List <string>();

                    if (!Directory.Exists(Dir))
                    {
                        Directory.CreateDirectory(Dir);
                    }

                    // look only for useful extensions
                    foreach (string Ext in RsyncExtensions)
                    {
                        string[] Files = Directory.GetFiles(Dir, "*" + Ext);
                        foreach (string SyncFile in Files)
                        {
                            // remember all local files
                            LocalFilenames.Add(Path.GetFileName(SyncFile));

                            string RemoteFilePath = ConvertPath(SyncFile);
                            // an upload command is local name and remote name
                            BatchUploadCommands.Add(SyncFile + ";" + RemoteFilePath);
                        }
                    }
                }

                // batch upload
                RPCUtilHelper.BatchUpload(BatchUploadCommands.ToArray());
            }
            else
            {
                List <string> RelativeRsyncDirs = new List <string>();
                foreach (string Dir in RsyncDirs)
                {
                    RelativeRsyncDirs.Add(Utils.CleanDirectorySeparators(Dir.Replace(":", ""), '/') + "/");
                }

                // write out directories to copy
                string RSyncPathsFile  = Path.GetTempFileName();
                string IncludeFromFile = Path.GetTempFileName();
                File.WriteAllLines(RSyncPathsFile, RelativeRsyncDirs.ToArray());
                File.WriteAllLines(IncludeFromFile, RsyncExtensions);

                // source and destination paths in the format rsync wants
                string CygRootPath = "/cygdrive";                // ConvertPathToCygwin(Path.GetFullPath(""));
                string RemotePath  = string.Format("{0}{1}",
                                                   UserDevRootMac,
                                                   Environment.MachineName);

                // get the executable dir for SSH, so Rsync can call it easily
                string ExeDir = Path.GetDirectoryName(ResolvedSSHExe);

                Process RsyncProcess = new Process();
                if (ExeDir != "")
                {
                    RsyncProcess.StartInfo.WorkingDirectory = ExeDir;
                }

                // --exclude='*'  ??? why???
                RsyncProcess.StartInfo.FileName  = ResolvedRSyncExe;
                RsyncProcess.StartInfo.Arguments = string.Format(
                    "-vzae \"{0}\" --rsync-path=\"mkdir -p {2} && rsync\" --chmod=ug=rwX,o=rxX --delete --files-from=\"{4}\" --include-from=\"{5}\" --include='*/' --exclude='*.o' --exclude='Timestamp' '{1}' {6}@{3}:'{2}'",
                    ResolvedRsyncAuthentication,
                    CygRootPath,
                    RemotePath,
                    RemoteServerName,
                    ConvertPathToCygwin(RSyncPathsFile),
                    ConvertPathToCygwin(IncludeFromFile),
                    RSyncUsername);
                Console.WriteLine("Command: " + RsyncProcess.StartInfo.Arguments);

                RsyncProcess.OutputDataReceived += new DataReceivedEventHandler(OutputReceivedForRsync);
                RsyncProcess.ErrorDataReceived  += new DataReceivedEventHandler(OutputReceivedForRsync);

                // run rsync
                Utils.RunLocalProcess(RsyncProcess);

                File.Delete(IncludeFromFile);
                File.Delete(RSyncPathsFile);
            }

            // we can now clear out the set of files
            RsyncDirs.Clear();
            RsyncExtensions.Clear();
        }