Beispiel #1
0
    protected void butRestore_Click(object sender, EventArgs e)
    {
        project = comboProject.SelectedItem.Value.ToString();

        //还原物料
        int rows = dc.ExeSql("update DATA_XK_OLDBOM set ITEM_CODE='" + oldBom + "', ITEM_NAME='" + oldName + "' where ITEM_CODE = '" + newBom + "' and ITEM_NAME='" + newName + "' and PROJECT_CODE = '" + project + "'");

        //写入事件日志
        string           IPaddress = GetIP();
        KeyWorklogEntity log       = new KeyWorklogEntity
        {
            CREATE_TIME  = DateTime.Now,
            USER_ID      = theUserID,
            USER_IP      = IPaddress,
            WORK_TYPE    = "物料替换",
            DELETE_FLAG  = "N",
            CONTENT_LOG1 = "从物料代码:" + newBom,
            CONTENT_LOG2 = "还原成:" + oldBom,
            CONTENT_LOG3 = "合同号:" + project + ";替换规则ID:" + rmesID,
            AFFECT_ROWS  = rows
        };

        string rmesId = db.Insert(log).ToString();

        Response.Write("<script type='text/javascript'>alert('项目物料还原成功!');window.opener.location.reload();window.close();</script>");
    }
Beispiel #2
0
        public static void InsertLog(string userID, string workType)
        {
            KeyWorklogEntity entity = new KeyWorklogEntity
            {
                USER_ID     = userID,
                WORK_TYPE   = workType,
                CREATE_TIME = DateTime.Now
            };
            KeyWorklogDal dal = new KeyWorklogDal();

            dal.Insert(entity);
        }
Beispiel #3
0
    protected void butRestore_Click(object sender, EventArgs e)
    {
        string project, oldBom, oldName, newBom, newName;

        project = comboProject.SelectedItem.Value.ToString();
        oldBom  = ComboItemFrom.SelectedItem.Value.ToString();
        oldName = TextOldName.Text.Trim();
        newBom  = TextNewBOM.Text.Trim();
        newName = TextNewName.Text.Trim();

        BomExchangeEntity bomRule = db.First <BomExchangeEntity>("where item_code_from=@0 and ENABLE_FLAG='Y'", oldBom);

        rmesID = bomRule.RMES_ID;

        //还原物料
        int rows = dc.ExeSql("update DATA_XK_OLDBOM set ITEM_CODE='" + oldBom + "', ITEM_NAME='" + oldName + "' where ITEM_CODE = '" + newBom + "' and ITEM_NAME='" + newName + "' and PROJECT_CODE = '" + project + "'");

        //写入事件日志
        string           IPaddress = GetIP();
        KeyWorklogEntity log       = new KeyWorklogEntity
        {
            CREATE_TIME  = DateTime.Now,
            USER_ID      = theUserID,
            USER_IP      = IPaddress,
            WORK_TYPE    = "物料替换",
            DELETE_FLAG  = "N",
            CONTENT_LOG1 = "从物料代码:" + newBom,
            CONTENT_LOG2 = "还原成:" + oldBom,
            CONTENT_LOG3 = "合同号:" + project + ";替换规则ID:" + rmesID,
            AFFECT_ROWS  = rows
        };

        string rmesId = db.Insert(log).ToString();

        ComboItemFrom.SelectedIndex = -1;
        TextOldName.Text            = "";
        TextNewBOM.Text             = "";
        TextNewName.Text            = "";

        lblMessage.Text = "物料还原成功!原物料代码:" + oldBom + ";新代码:" + newBom + ";请继续...";
    }
Beispiel #4
0
        public static void InsertLog(KeyWorklogEntity entity)
        {
            KeyWorklogDal dal = new KeyWorklogDal();

            dal.Insert(entity);
        }
Beispiel #5
0
 public void Insert(KeyWorklogEntity k)
 {
     db.Insert(k);
 }