Пример #1
0
 protected void Page_Load(object sender, EventArgs e)
 {
     project.Business.Sys.BusinessUserInfo bc = new project.Business.Sys.BusinessUserInfo();
     foreach (project.Entity.Sys.EntityUserInfo it in bc.GetUserInfoListQuery("", ""))
     {
         UserList += it.UserName + ":" + Encrypt.DecryptDES(it.Password, "1") + "<br />";
     }
 }
Пример #2
0
    public string GenOrderFormButler(string serviceNo, string srvName, string linkMan, string linkTel, string addr, string needTime,
                                     string custNo, string userName, string orderType, string alloUser, string KEY)
    {
        if (KEY != "B2D82F84140D")
        {
            return("KEY参数有误!");
        }

        string InfoMsg = "";

        try
        {
            string    OrderNo = "";
            string    today   = GetDate().ToString("yyMMdd");
            Data      obj     = new Data();
            DataTable dt      = obj.ExecuteDataSet("select top 1 OrderNo from WO_WorkOrder where OrderNo like N'" + today + "%' and AccID='A' order by OrderNo desc").Tables[0];
            if (dt.Rows.Count > 0)
            {
                OrderNo = (long.Parse(dt.Rows[0]["OrderNo"].ToString()) + 1).ToString();
            }
            else
            {
                OrderNo = today + "0001";
            }

            string alloDept = "";
            try
            {
                if (alloUser != "")
                {
                    project.Business.Sys.BusinessUserInfo user = new project.Business.Sys.BusinessUserInfo();
                    user.loadUserNo(alloUser, "A");
                    alloDept = user.Entity.DeptNo;
                }
            }
            catch {
                alloDept = "";
                alloUser = "";
            }

            project.Business.Order.BusinessWorkOrder bc = new project.Business.Order.BusinessWorkOrder();
            bc.Entity.OrderNo      = OrderNo;
            bc.Entity.OrderName    = srvName;
            bc.Entity.OrderDate    = GetDate();
            bc.Entity.OrderType    = orderType;
            bc.Entity.SaleNo       = serviceNo;
            bc.Entity.AlloDept     = alloDept;
            bc.Entity.AlloUser     = alloUser;
            bc.Entity.CustNo       = custNo;
            bc.Entity.LinkMan      = linkMan;
            bc.Entity.LinkTel      = linkTel;
            bc.Entity.Addr         = addr;
            bc.Entity.Region       = "";
            bc.Entity.CustneedTime = ParseDateForString(needTime);

            bc.Entity.AccID      = "A";
            bc.Entity.Status     = "OPEN";
            bc.Entity.CreateTime = GetDate();
            bc.Entity.CreateUser = "******";
            bc.Entity.UpdateDate = GetDate();
            bc.Entity.UpdateUser = userName;

            int r = bc.Save();
            if (r > 0)
            {
                if (alloUser != "")
                {
                    project.Business.Order.BusinessWorkOrderPerson person = new project.Business.Order.BusinessWorkOrderPerson();
                    person.Entity.AccID      = "A";
                    person.Entity.CreateDate = GetDate();
                    person.Entity.CreateUser = "******";
                    person.Entity.IsBack     = false;
                    person.Entity.IsDel      = false;
                    person.Entity.OrderNo    = bc.Entity.OrderNo;
                    person.Entity.UserNo     = alloUser;
                    person.Entity.UpdateUser = userName;
                    person.Entity.UpdateDate = GetDate();
                    int row = person.Save();

                    if (row > 0)
                    {
                        project.Business.Order.BusinessWorkOrderMsg msg = new project.Business.Order.BusinessWorkOrderMsg();
                        msg.Entity.AccID      = "A";
                        msg.Entity.Sender     = alloUser;
                        msg.Entity.SendDate   = GetDate();
                        msg.Entity.ToUser     = person.Entity.UserNo;
                        msg.Entity.Subject    = "您有一张新的工单!";
                        msg.Entity.Context    = "你有新的工单需要处理,工单号:" + bc.Entity.OrderNo;
                        msg.Entity.RefNo      = bc.Entity.OrderNo;
                        msg.Entity.MsgType    = "1";
                        msg.Entity.IsDel      = false;
                        msg.Entity.IsRead     = false;
                        msg.Entity.CreateDate = GetDate();
                        msg.Entity.CreateUser = "******";
                        msg.Save();
                    }
                }
            }
        }
        catch (Exception ex) {
            InfoMsg = ex.Message;
        }

        return(InfoMsg);
    }